Embedding multiple components in Flash
This week's featured product
Store Locator
This cool AJAX application will enhance your website by showing your stores' locations. You can also display an image and a short description so your users know exactly where to find your business.
Become a premium member
Flabell and Themesbell membership provides users with the ability to download any of our components for Adobe Flash and website themes for free, during an entire year.
read more


Subcribe to topic RSS

Products RSS Feed
Follow us on twitter
support@themesbell.com
MorgrathAZ
on 7/2/11
I'm embedding a rotating banner component and a horizontal image scroller component into an existing Flash AS3 file. I'm getting some errors for the XML path and vuzum banner.as. Do I need to have only one XML file and path? What other code do I need in the AS frame?
Here's what I have now:
// XML VARS
var pathToFiles : String = "banner/";
var xmlPath : String = "xml/banner.xml";
var pathToFiles : String = "slider/";
var xmlPath : String = "xml/slider.xml";
// SAMPLE INIT OF THE COMPONENT
mcBanner.init(440, 132, pathToFiles, xmlPath);
mcSlider.init(440, 132, pathToFiles, xmlPath);
on 8/2/11
// XML VARS
var pathToFiles : String = "banner/";
var xmlPath : String = "xml/banner.xml";
// SAMPLE INIT OF THE COMPONENT
mcBanner.init(440, 132, pathToFiles, xmlPath);
pathToFiles = "slider/";
xmlPath = "xml/slider.xml";
mcSlider.init(440, 132, pathToFiles, xmlPath);
But, when you'll try embedding other multiple Flabell projects in a single flash project, you'll have to be careful. The files that we reuse, like the Prototypes class, are updated constantly. For example, the Prototypes from the Flash Banner Rotator might be different than the one from the Flash Video Player with Playlist (which is our newest component, right now).
The solution for this is using a different package for the classes or renaming the Prototypes.as file and then update all its references in the Action Script files.
on 8/2/11
I tried this, the banner layer actually plays fine, but I'm still getting an error on the slider component:
TypeError: Error #1006: init is not a function.
at Banner_SliderAS3Test_fla::MainTimeline/frame1()
Any suggestions of how to fix? I believe I have all of the assets in the right place for the Slider.
MorgrathAZ
on 8/2/11
MorgrathAZ
on 8/2/11
Last edit on 8/2/11
on 10/2/11
To make this work on your project you'll just have to find this line in the Slider.as file:
if(mcBack.hitTestPoint(mouseX, mouseY))
and change it like this:
if(mcBack.hitTestPoint(this.x + mouseX, this.y + mouseY))
It should do it after you republish the SWF file.
Last edit: on 10/2/11
MorgrathAZ
on 10/2/11
on 11/2/11