dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: addItem from external SWF

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    105

    addItem from external SWF

    Hi All.
    Perhaps some one can help me out.

    I've got my main SWF file which adds items to a list box. I've put this actionscript in the same clip as the drop down:
    MLfunction.addItem("FadeOut", "FadeOut");

    This works fine and populates the drop down.

    Now, I'm trying to addItems to that same drop down from an externally loaded Swf.

    I've tried putting the following script in the first frame of the externally loaded clip - but it doesn't add the item to the drop down:
    _level0.buttonMC.EditMenu.MLfunction.addItem("Fade Out2", "FadeOut2");

    Anyone know why this wouldn't work or if it's possible?

    Thanks.
    Mario Cascio
    Webpromotion, Inc.
    http://www.webpromotion.com

    Royalty Free 3D Flash Animation
    http://www.webpromotion.com/fp01.html

  2. #2
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    Where did u load ur swf to? level or mc (wat is the mc name? is the mc on the main timeline?)?

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    105
    Hello hye,

    I've simplified things even farther just for troubleshooting purposes.

    Instead of loading an swf I just tried putting this code in the same frame as the drop down inside a Movieclip:
    _level0.buttonMC.EditMenu.MLfunction.addItem("Fade Out2", "FadeOut2");

    Great - it works fine.

    Now I try moving this script (noted above) to another movieclip within the same SWF and it doesn't work.

    ANy ideas?
    Mario Cascio
    Webpromotion, Inc.
    http://www.webpromotion.com

    Royalty Free 3D Flash Animation
    http://www.webpromotion.com/fp01.html

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Would be much easier if you attached your .fla, rather than me (or any other!), trying to recreate it.

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    105
    Hey Guys,

    Thanks for trying to help.

    While creating a basic FLA for the forum, I figured out what the problem was. My combo box was located in another MC but wasn't appearing on the first frame. Apparently, even though the combo box is in the Movie, unless it's actually available when the additem script is called, it doesn't seem to work.

    I solved the problem by setting the combo box visibility to false in the first frame and then true when I actually need it.

    Too bad it doesn't just work.

    Perhaps there is another solution that I'm not aware of. Hopefully this will help someone else in a similar situation.
    Mario Cascio
    Webpromotion, Inc.
    http://www.webpromotion.com

    Royalty Free 3D Flash Animation
    http://www.webpromotion.com/fp01.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center