Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I preload an external swf file into my main timeline?

Explorer ,
Mar 19, 2009 Mar 19, 2009
In trying to keep file size down for download time... I have a SWF file that I have placed using the "UILoader" component (not sure if this is the correct thing to do)... what I would like to work out is how to make a preloader within my main timeline for this SWF file when it comes in...

I hope that makes sense - I am very new to all this and struggling with terminology etc.

I figured Actionscript would be what I need - but no clue right now...
TOPICS
ActionScript
906
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Mar 22, 2009 Mar 22, 2009
I am finishing off this thread for people that are looking for a way to preload external SWF files. Please note however that I have started a new thread about unloading the file again on a mouse event... so although this is not completely final it will start the process of preloading an external SWF... Hope it helps someone.
Translate
Guest
Mar 19, 2009 Mar 19, 2009
Bimibear,

Well, you just gotta be patient with Actionscript. You do need to employ a pre-loader which will load your content on runtime. Try this tutorial, this will do the trick:

http://www.actionscript.org/forums/showthread.php3?t=151850

Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 19, 2009 Mar 19, 2009
combustion007,

Thanks for the reply...
I found the following code in a book which I have been able to implement, however I can't get the external swf to disappear after playing... any ideas?

I am such a newbie with Actionscript - but I am determined to keep trying
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 19, 2009 Mar 19, 2009
combustion007,
my apologies - I meant to also say regarding the link you sent that I was not sure how this would work with retrieving the swf file... the more i read the more confused I get...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 20, 2009 Mar 20, 2009
Hey Bimibear,

show your entire code, so I can then see what is going on. You need to get debugging going. The above code looks good to me, but how about just simply load the swf file locally and see it goes well without the preloader.

Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 21, 2009 Mar 21, 2009
Hi combustion007,
Thanks for the offer - my file is at work - so wont be back until Monday... if you wouldn't mind looking at it then that would be fantastic. Not sure how to show the entire code though... that's the only code I have put on that frame... what else do I need to put up for you to see?

Thanks again.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 21, 2009 Mar 21, 2009
For the code you showed to preload the swf, you should assign the event listeners before the command to load... not so much a necessity, just a better practice.

You now seem to want to get rid of the swf once it has loaded and played itself thru. To do that you would need to have something in the swf itself that triggers its removal in its last frame. The following might work...

MovieClip(this.parent).removeChild(this);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 22, 2009 Mar 22, 2009
Hi NedWebs,

Thanks for that - I will give it a try.
Do you how I would be able to get the SWF to loop UNLESS another button on the main SWF has been clicked or rollover?
Many thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 22, 2009 Mar 22, 2009
quote:

Originally posted by: NedWebs

You now seem to want to get rid of the swf once it has loaded and played itself thru. To do that you would need to have something in the swf itself that triggers its removal in its last frame. The following might work...

MovieClip(this.parent).removeChild(this);


Unfortunately I couldn't get this to work. I placed it on the last frame of the SWF to be called - is that right?
I am not sure I am doing it correctly...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 22, 2009 Mar 22, 2009
I now know how to get the external files to load - but after some investigation I have realised I need to unload the file when a mouse event occurs... does anyone know how I can achieve this - I have googled all day but haven't been successful in finding the solution - have reached ripping out the hair stage!

Any help would be greatly appreciated.
Many thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 22, 2009 Mar 22, 2009
LATEST
I am finishing off this thread for people that are looking for a way to preload external SWF files. Please note however that I have started a new thread about unloading the file again on a mouse event... so although this is not completely final it will start the process of preloading an external SWF... Hope it helps someone.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines