I am trying to add in an existing swf file to a timeline and have it fade in using the opacity while it plays. I am very new to flash and am having difficulty getting it to work. I assume in order for the opacity to work, there must be a symbol set up for this...however, I am not sure how to add in the swf...I've gotten suggestions on adding some code, i.e. loadMovie, etc...but since I've tried addintg the code to the symbol timeline, it still will not work the way I described above. I've attached a zip file of my attempt (fla) along with the swf file I am trying to load...if anyone who knows how to do this would not mind adjusting my file for me and reposting...that would be great. I think having a file in front of me that works would be much better than reading a post of how to do it...thanks for all your help. JH
I'm not sure what that reply was all about, I checked that link, but it jus brought me back to my post and your link reply???
Try something like this. loadMovie("fox.swf", _root.loader); // loader is an empty movie clip that you use to load the swf once the movie is loaded do this. if (_root.loader != undefined) { loader._alpha = 0; while ( _root.loader.getBytesLoaded() < _root.loader.getBytesTotal() ) { // run some loading code (not required) } // start fade in id = setInterval(fadeIt, 1000); // 1000 is the time in milliseconds til the function is run again function fadeIt() { if (_root.loader._alpha < 100) _root.loader._alpha += 5; // this adds 5 to the value of alpha else clearInterval( id ); // stops the function from running every second }
OK...thanks for the clarification and the code. I will try that, but I am still a bit confused as to where exaclty to put the code, and how if might work/interfere with other symbols in my timeline....like other image symbols that will fade in before or after this swf symbol. In any case, I will try that out, see if I can't get a handle on things from there and post if I have any questions...thanks again. JH
you asked is there a quick link to your old post :P I meant to post the link there hehe! [quoted text, click to view] "jfharper" <webforumsuser@macromedia.com> wrote in message news:ccufbr$fli$1@forums.macromedia.com... > I'm not sure what that reply was all about, I checked that link, but it jus brought me back to my post and your link reply??? > JH
BuffDog, I tried the following and I could not get it work at all...here are some questions I have. loadMovie("fox.swf", _root.loader); // loader is an empty movie clip that you use to load the swf - OK, am I supposed to have a symbol named "loader" in my fla? and am I supposed to put this code on the symbol's timeline or the main timeline? once the movie is loaded do this. if (_root.loader != undefined) { loader._alpha = 0; } - I cut out the while statement cuz I wanted to keep things simple to begin with. // start fade in id = setInterval(fadeIt, 1000); // 1000 is the time in milliseconds til the function is run again function fadeIt() { if (_root.loader._alpha < 100) _root.loader._alpha += 5; // this adds 5 to the value of alpha else clearInterval( id ); // stops the function from running every second - I added all of the above code to the same keyframe (5) on my main timeline, I also striped the loader movie clip symbol contained in my fla...the fox.swf file is in the same directory as the fla file, and nothing happened at all...would you mind clarify where I might have gone wrong...thanksl JH
Don't see what you're looking for? Try a search.
|