Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 5 of 5
  1. #1

    Default controlling external .swf in root movie

    i am trying to go to a specific frame in a external .swf that is loaded into an empty movie clip. the code i am using is:

    Code:
    on (release) {
    	gotoAndStop(25);
    	loadMovie("FoodPage.swf", _root.dropzone);
    	 _root.dropzone_mc.gotoAndStop(5);
    }
    for some reason this is not working. any help would really be appreciated. thanks

  2. # ADS
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The movie has not fully loaded when the code is trying to tell it's timeline to gotoAndStop(5). You can account for the load time with a delay before calling the code. There are two options that come to mind. The first is using an onload method. Movieclips have an onload property to determine when the external movie has loaded.....

    myMC.onLoad=function(){
    //do something;
    }

    The second option would be to check the holder movieclips width or height, assuming that your using an empty movieclip to load to. Once the external movie is loaded, the empty clips width and height are no longer 0. You can use this to control the clip.

    if(holderMC._width>0){
    holderMC.gotoAndStop(5);
    }

    Much of it will depend on the structure of your project, but the overall problem your describing is that your trying to control the loaded movies timeline before it is completely loaded.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    where could i fit that in my code

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Try...

    _root.dropzone_mc.onLoad=function(){
    this.gotoAndStop(5);
    }
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  6. #5

    Default

    NTD,

    I the code......

    _root.dropzone_mc.onLoad=function(){
    this.gotoAndStop(5);
    }


    "this" keyword referes to dropzone_mc or the external swf i.e. FoodPage.swf that is being loaded.

    Thanks

    Shashank

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Controlling External SWF to unload after last frame
    By Capt. Krainium in forum Advanced Flash
    Replies: 1
    Last Post: 03-28-2006, 01:40 PM
  2. SWF file not functioning unless in root folder
    By downesy in forum General Flash
    Replies: 1
    Last Post: 11-21-2005, 01:32 PM
  3. External Movie issues
    By sfbell in forum Flash Scripting
    Replies: 2
    Last Post: 05-20-2005, 04:19 PM
  4. Replies: 1
    Last Post: 01-23-2005, 02:22 PM
  5. Controlling Button State
    By nusharp in forum Newbies
    Replies: 3
    Last Post: 01-07-2004, 07:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial