A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [MX04] Manipulating loaded .swfs from host .swf?

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    56

    [MX04] Manipulating loaded .swfs from host .swf?

    Hey all.

    I have a host .swf which loads 4 smaller .swf files at startup. These files play and loop indefinitely. They're each loaded into different movie clip instances, so that I can add masks/modify colors/toy with their transparency. What I'm trying to do is have a loaded .swf file start over from the first frame when it is clicked, but I'm running into trouble directing them to do so from the host .swf.

    I've been able to restart the loaded .swfs by reloading them via loadMovie(), but this causes the .swf to disappear for a few seconds as it loads again, which is unacceptable.

    Does anyone have any ideas? Thanks much in advance.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    use the instance name of the clip that loads the external movie -

    if you have -
    holder1.loadMovie("ext1.swf");

    to control ext1.swf, use -
    holder1.gotoAndPlay(1);

    hth

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    56
    Thank you! That works. Though admittedly I'm still having problems; the loaded .swfs consist entirely of scripted tweens of externally loaded images. I'm realizing that it's not adequate to have a blank, unscripted frame to gotoAndPlay() to, since that has the loaded .swf become blank momentarily, and also seems to cause occasional errors with the Tweens. So, I suppose what I need to ask now is: is there a simple way to reset all the tweens in a frame? And if so, can I do it from a host .swf?

    Thanks again. I apologize for my extraordinarily sluggish response.

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you could place all of the scripted tweens in a global function -

    _global.init = function(){
    // your code
    }

    as the function is global it is open to all scopes of the player session,
    so you can activate the function from any timeline with -

    init();

    hth ??

  5. #5
    Member
    Join Date
    Aug 2006
    Posts
    56
    Thank you very much! This appears to be exactly the code I need. Though admittedly I still have to struggle through the tangled mess of tweens and dynamic loading I've assembled. I'll see if I can get it to work.

    Thanks again!

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