Gaming, Computer Tech & Electronics Fortnite.CounterStrike.CallOfDuty.Dota.MineCraft.
Tips & tricks, tech support, home theatre, online gaming, reviews, latest news... |  |
08-02-2011, 01:13 AM
|
#1 | HELP ME PLS!!!
Join Date: Nov 2004 Location: Coquitlam
Posts: 5,608
Thanked 10 Times in 10 Posts
Failed 18 Times in 3 Posts
| Flash ActionScript Help Please Hello everyone. I've been trying to get this working for the past month. I searched as much as I could and everywhere that I could. Please help with my situation.
I'm loading external swf files to a movie container, but I want to show a preloader before it is ready and play. The problem is the preloader get stop prematurely and there is a gap between the preloader stopping and the movie playing.
**************************************************
BUTTON: (note that button is not on _root, but within containers after containers, and it will be extremely difficult to redo all that animation work)
on (rollOver, dragOver) { //as2 on button
gotoAndPlay(2); //animation of the button
_root.PrevCon._visible = false; //make movie container invisible
loadMovie("path here", _root.PrevCon); //load movie to container
_root.PreLoadCon.gotoAndStop(2); //frame 2 of preloader container plays it
}
on (rollOut, dragOut) {
gotoAndStop(1); //animation of the button
unloadMovie(_root.PrevCon); //unload movie from container
_root.PreLoadCon.gotoAndStop(1); //frame 1 of preloader container stops it
}
//this part is irrelevant but i purposely dun load it on release
on (release) {
_root.pro_btn.gotoAndPlay(2);
_root.gotoAndPlay(3);
}
**************************************************
MOVIE CONTAINER: (aka PrevCon)
onClipEvent (enterFrame) { //as2 on movie clip
if (this.getBytesTotal != 0) { //if something is loaded
if (this.getBytesLoaded() == this.getBytesTotal()) { //if it's complete
_root.PreLoadCon.gotoAndStop(1); //preloader animation stops
_root.PrevCon._visible = true; //movie is visible
}
}
}
**************************************************
PRELOADER CONTAINER: (aka PreLoadCon)
No script except stop() on frame 1 and 2 on action layer, and on animation layer frame 1 is clear and frame 2 has self play animation that keeps on looping.
**************************************************
Any help to solve this would be greatly appreciated. It has been many restless nights after work.
Cheers~
__________________ "Be water, my friend." (Bruce Lee)
"I would complain about severe understeer and they would show me how it was me, the nut behind the wheel that caused the understeer." (Alex Chiu - Director of Velocity Driver Development)
"I drift not because it is a quicker way around a corner, but it is the most exciting way" (Keiichi Tsuchiya - Drift King)
"With chocolate, you know what you're gonna get and I can't always be delicious." |
| |
08-03-2011, 11:24 AM
|
#2 | HELP ME PLS!!!
Join Date: Nov 2004 Location: Coquitlam
Posts: 5,608
Thanked 10 Times in 10 Posts
Failed 18 Times in 3 Posts
|
Please?
__________________ "Be water, my friend." (Bruce Lee)
"I would complain about severe understeer and they would show me how it was me, the nut behind the wheel that caused the understeer." (Alex Chiu - Director of Velocity Driver Development)
"I drift not because it is a quicker way around a corner, but it is the most exciting way" (Keiichi Tsuchiya - Drift King)
"With chocolate, you know what you're gonna get and I can't always be delicious." |
| |
08-03-2011, 09:27 PM
|
#3 | My dinner reheated before my turbo spooled
Join Date: Aug 2002 Location: Richmond
Posts: 1,706
Thanked 10 Times in 7 Posts
Failed 0 Times in 0 Posts
|
rather than listening on the enter frame event, why dont you listen on the movie load event/movie ready. once the movie is done loading, then you for sure know the video is ready to play.
|
| |
08-03-2011, 09:36 PM
|
#4 | HELP ME PLS!!!
Join Date: Nov 2004 Location: Coquitlam
Posts: 5,608
Thanked 10 Times in 10 Posts
Failed 18 Times in 3 Posts
| Quote:
Originally Posted by c_loke rather than listening on the enter frame event, why dont you listen on the movie load event/movie ready. once the movie is done loading, then you for sure know the video is ready to play. | So I should change the function for Movie Container? What should I use to replace the first line?
***** onClipEvent (enterFrame) {
*****
__________________ "Be water, my friend." (Bruce Lee)
"I would complain about severe understeer and they would show me how it was me, the nut behind the wheel that caused the understeer." (Alex Chiu - Director of Velocity Driver Development)
"I drift not because it is a quicker way around a corner, but it is the most exciting way" (Keiichi Tsuchiya - Drift King)
"With chocolate, you know what you're gonna get and I can't always be delicious." |
| |
08-03-2011, 09:40 PM
|
#5 | HELP ME PLS!!!
Join Date: Nov 2004 Location: Coquitlam
Posts: 5,608
Thanked 10 Times in 10 Posts
Failed 18 Times in 3 Posts
|
onClipEvent(load)?
__________________ "Be water, my friend." (Bruce Lee)
"I would complain about severe understeer and they would show me how it was me, the nut behind the wheel that caused the understeer." (Alex Chiu - Director of Velocity Driver Development)
"I drift not because it is a quicker way around a corner, but it is the most exciting way" (Keiichi Tsuchiya - Drift King)
"With chocolate, you know what you're gonna get and I can't always be delicious." |
| |
08-03-2011, 10:51 PM
|
#6 | HELP ME PLS!!!
Join Date: Nov 2004 Location: Coquitlam
Posts: 5,608
Thanked 10 Times in 10 Posts
Failed 18 Times in 3 Posts
|
I got it! Thank you so much you're a genius! I was afraid of a huge fix; but 1 word!
__________________ "Be water, my friend." (Bruce Lee)
"I would complain about severe understeer and they would show me how it was me, the nut behind the wheel that caused the understeer." (Alex Chiu - Director of Velocity Driver Development)
"I drift not because it is a quicker way around a corner, but it is the most exciting way" (Keiichi Tsuchiya - Drift King)
"With chocolate, you know what you're gonna get and I can't always be delicious." |
| |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 01:32 PM. |