LOGIN Don't have an account yet?   Register

Forgot password?
 

Embedding multiple components in Flash

  • avatar
    MorgrathAZ
    on 7/2/11
    Hi,
    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);
  • avatar corneliu.chitanu
    on 8/2/11
    This will work for you:

    // 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.
  • avatar MorgrathAZ
    on 8/2/11
    Thanks Corneliu,

    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.
  • avatar
    MorgrathAZ
    on 8/2/11
    Okay, I figured out that the error was because the vuzum folder was missing the "Slider" pieces, but now the image scroller plays, but doesn't function as expected... when the page loads, the images are scrolling, but when I mouse over, they freeze and won't scroll anymore... is this due to the problem you indicated of the Prototypes file perhaps not being the same between components?
  • avatar
    MorgrathAZ
    on 8/2/11
    Okay, have everything working now except the scrolling only works if the mcSlider movieclip is at the 0x and 0y position on the stage. How do I move the active slider area to another position on the stage? Moving the movieclip element doesn't do it.

    Last edit on 8/2/11
  • avatar corneliu.chitanu
    on 10/2/11
    Hi,

    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
  • avatar
    MorgrathAZ
    on 10/2/11
    Worked perfectly! Thanks again!
  • avatar corneliu.chitanu
    on 11/2/11
    You're welcome!

rss Subcribe to topic RSS

Post a comment

Please login to join the discussions. Don't have an account? Register (it takes 30 seconds)

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

premium membership 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