Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Load SWF at specific frames

Recommended Posts

Hi guys, i'm new to as 3.0 and need help


i want to load an external child.swf with some frames in its timeline


and then the main.swf shows some movieclip with different frames from child swf.(like a gallery)


how can i do that ? i have tried and just get confused


please help and thanks a lot :)

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.


The support we provide here is very specific to usage of our LoaderMax tools, not so much about giving full directions on building a complete project.


That said, I've attached a sample that shows how to load one swf into another, which should get you started.


the code looks like this:


import com.greensock.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.SWFLoader;

var intro:SWFLoader = new SWFLoader("intro.swf", {container:this, x:100, y:100, onComplete:completeHandler});

function completeHandler(e:LoaderEvent):void{
trace(e.target) // the loader that fired the event
trace("intro complete");

Please spend some time with the SWFloader docs:



And read/watch read this tutorial:





Although it focuses on images and not swfs, 90% of the concepts apply to both.




After getting some of your own files to work, feel free to ask more questions about how to work with SWFLoader, targeting the loaded swf, calling functions in the loaded swf (play, stop), etc.









Link to comment
Share on other sites

thanks for reply, but i still have the question


i have follow the method from snorkl.tv , it help me for loading an image files in that way :)


but now the problem is, if the images are in the one swf and distributed in different frames then i want to show it like a gallery in the main swf

Link to comment
Share on other sites

you can communicate with swf that a SWFLoader loads via its rawContent.

var gallery:SWFLoader = new SWFLoader("gallery.swf", {...});

after the swf is loaded

//goto a frame inside the loaded swf

//change the alpha of mc inside gallery.swf
gallery.rawContent.mc.alpha = 0.5;

basically you can communicate with and control the loaded swf and its contents however you choose. Hope this helps.

Link to comment
Share on other sites

thanks again for reply, i have tried the instruction


but i still have the problem


better see what i want to ask with illustration in attached files :)


Link to comment
Share on other sites

I took a look at your files. The illustrations are very clear and charming. Thank you.


Unfortunately you are going about this in a way that won't work by having your content in slide.swf be on different frames. It is impossible to show more than 1 frame at a time.


The illustration in frame 1 of main, has a space for each frame of the loaded swf to be displayed. This can't be done if each slide is on a different frame.


The illustration in frame 2 of main shows that each frame should slide in and out of view, again you can't show frame 1's content at the same time as frame 2's content.


The solution is to have all the "slides" in different movie clips on the same frame. slides.swf should only be a single frame with 4 movie clips side by side.


Screen Shot 2013-05-09 at 2.49.12 PM.png


Ideally those 4 movie clips would all be in another movie clip that you slide back and forth (to handle the needs of the interactive gallery transitions).


For the first frame (4 thumbnails side by side) you can use actionscript to either make duplicates of the large movie clips and shrink them down and position them, or just do it manually in flash.


Either way there is a good deal of work involved in re-organizing this project that I can't do for you right now. Hopefully you get the concept of breaking the frames into movie clips and can proceed in that direction.





Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.