Skip to main content
Inspiring
August 9, 2016
Answered

how to have loaded movie communicate with loader

  • August 9, 2016
  • 1 reply
  • 1422 views

I have a movie that loads different swfs on different frames. When the loaded movie is done, I want a next button that can tell the loader to go to frame 2.

Tried several methods. Any help would be greatly appreciated!

This topic has been closed for replies.
Correct answer kglad

the loader.fla file uses a UILoader, so there is no code. I created another file using object loader. That file uses this:

var swfLoader:Loader = new Loader();

var swfFile:URLRequest = new URLRequest("step_1.swf");

var container:MovieClip= new MovieClip();

swfLoader.load(swfFile);

container.addChild(swfLoader);

addChild(container);

That also fails. The traces are:

[object Loader]

[object MovieClip]

instance2

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@7fff9c15ea1 to flash.display.MovieClip.

at step_1_fla::MainTimeline/frame2()


you must be changing your code to cause different error messages and that's making it difficult to help you.

if you leave the code in message 16, use:

MovieClip(this.parent.parent.parent).gotoAndStop(2)

in the loaded swf.

1 reply

kglad
Community Expert
Community Expert
August 9, 2016

where's the code that determines when the loaded swf has completed play?

mhunterAuthor
Inspiring
August 9, 2016

There will be a button that pops up on the last frame of the loaded movie. Trying to figure out the path to the parent...

kglad
Community Expert
Community Expert
August 9, 2016

yes. On frame 2. I get "Cannot access a property" when I run that swf, and the coercion error when I run the loader.


you can't 'run' that swf.

you publish it and it's loaded.

in your loading swf is your loader added to the display before loading is complete?

if so, what's the exact error?