Quantcast

Flash pre loader question

pnj

Turbo Monkey till the fat lady sings
Aug 14, 2002
4,696
40
seattle
I know some of you know Flash pretty well. I don't use it much and tend to forget everything I learned when I do need to use it...

I have an SWF file that was created by another program (Camtasia). I want to create a Flash file that will be a preloader that will call or load the SWF created by Camtasia.

all the preloader examples I have seen (flashkit/werehere, etc) just call the same timeline/flash file.

any suggestions?

thanks.
 

Duffle

Chimp
May 9, 2005
53
0
Doing the MUni
mmm. I'd suggest using a preloader component if you can find one that suits your needs. Using actionscript to load the movie wouldn't be too difficult either, I'm happy to help with that...just let me know
 

pnj

Turbo Monkey till the fat lady sings
Aug 14, 2002
4,696
40
seattle
I don't care how it's done, I just need to be able to do it....:)

action script seems better to me.
 

pixelninja

Turbo Monkey
Jun 14, 2003
2,131
0
Denver, CO
This issue here is that you want to create a preloader that knows how much of an imported .swf is loaded. All the preloaders I've created have been within the same file. If I do a loadmovie, I build the preloader into the .swf that is being loaded. If you can't find the info you're looking for on werehere, then you're probably out of luck. Have you asked this question in their forums?

Here's what I might do:
1. Open a new Flash file.
2. Import the existing .swf into it.
3. Add a few frames to the beginning of the file and add a loading script. If you don't know how to do this, I have the code.
4. Load this new .swf into your main .fla. When it loads, it will hit the loading script and do its thing.

DISCLAIMER: I have no experience with Actionscript 2, so I don't know if it has the power to do what you want to do. If you're using Flash MX 2004, then I can't help you.
 

pnj

Turbo Monkey till the fat lady sings
Aug 14, 2002
4,696
40
seattle
pixelninja said:
blah blah blah.....
:D

ok, I don't know why but I had trouble last night getting my SWF into flash....:nuts:

now that I can get my SWF's into Flash, I can add a few frames at the start of the whole file. so I now just need to get some good code to do the preloader thing....
I should be able to resave the file and export the thing again as an SWF right? or will that recompress my already compress SWF that I imported into Flash?

I was trying Loadmovie() and having no luck....

thanks!
 

pnj

Turbo Monkey till the fat lady sings
Aug 14, 2002
4,696
40
seattle
ok, scratch what I just said. It doesn't work, it drops the audio that is in my original SWF that I import into Flash.

so I need to create a SWF preloader file that loads the existing SWF...Arg.
 

pnj

Turbo Monkey till the fat lady sings
Aug 14, 2002
4,696
40
seattle
yea, that was way more code then needed, I think.

I was able to do it using one SWF w/ two frames.
frame one had action script along these lines.
Code:
loadmovie("full_lenght.swf", _root.)
second frame was simply
GotoAndPlay(frame1)

another way to do it is to load the second SWF but before you display it, see how much of it is loaded.
if
{loadmovie("full_length.swf".framesLoaded==full_length.swf.length)
then loadmovie("full_length.swf",_root.)
}

that code is from my head so it is definitly NOT the correct syntax. but you should be able to understand what is going on. check the length of the movie to be loaded, if it's all loaded, play it...

however, none of this matters to me because apparently Camtasia can do a preloader for you. when you save/export a file from Camtasia as an SWF, it gives you the option to use a preloader. I created a simple one in flash, saved it as an SWF and told Camtasia where it was. the downside is, camtasia creates about FIVE files, one being an XML document. what it doesn't say in the help file is, you have to change some code in the XML doc to get the preloader to display.....nice. it only took me 3 hours to figure that one out...:nuts: