A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] loadMovie("my.swf")

  1. #1
    Senior Member Ovaire d'Oz's Avatar
    Join Date
    May 2006
    Location
    France
    Posts
    148

    resolved [RESOLVED] loadMovie("my.swf")

    Hello,
    I am trying to load a SWF file into another one. In the main one I have this:
    PHP Code:
    web.loadMovie("webb.swf"); 
    In webb.swf I have this:
    PHP Code:
    var i:Number;
    for (
    i=0i<4i++){
        
    attachMovie("title","web"+i,10+i);
        
    _root["web"+i]._x 20;
        
    _root["web"+i]._y 20+20*i;

    But when I open the main swf and it loads webb.swf, the movie clips of webb.swf are not displaying as I am trying to make them display.


    In other words, why are not the MCs in their x and y place?

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    You're using _root, which is wrong. Swf's have their own levels. the _root of a swf is level_0. But, if you load a swf into another swf your _root of the loaded swf is now level_1, but _root still points to level_0. Try this:

    var i:Number;
    for (i=0; i<4; i++){
    var a:MovieClip = attachMovie("title","web"+i,10+i);
    a._x = 20;
    a._y = 20+20*i;
    }
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  3. #3
    Senior Member Ovaire d'Oz's Avatar
    Join Date
    May 2006
    Location
    France
    Posts
    148
    Thanks a lot for the script, it works perfect, and for the level trick.

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