REVscene - Vancouver Automotive Forum


Welcome to the REVscene Automotive Forum forums.

Registration is Free!You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! The banners on the left side and below do not show for registered users!

If you have any problems with the registration process or your account login, please contact contact us.


Go Back   REVscene Automotive Forum > Vancouver LifeStyles (VLS) > Gaming, Computer Tech & Electronics

Gaming, Computer Tech & Electronics Fortnite.CounterStrike.CallOfDuty.Dota.MineCraft.
Tips & tricks, tech support, home theatre, online gaming, reviews, latest news...

Reply
 
Thread Tools
Old 08-02-2011, 01:13 AM   #1
HELP ME PLS!!!
 
Gachinto's Avatar
 
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~
Advertisement
__________________
"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."
Gachinto is offline   Reply With Quote
Old 08-03-2011, 11:24 AM   #2
HELP ME PLS!!!
 
Gachinto's Avatar
 
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."
Gachinto is offline   Reply With Quote
Old 08-03-2011, 09:27 PM   #3
My dinner reheated before my turbo spooled
 
c_loke's Avatar
 
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.
c_loke is offline   Reply With Quote
Old 08-03-2011, 09:36 PM   #4
HELP ME PLS!!!
 
Gachinto's Avatar
 
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 View Post
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."
Gachinto is offline   Reply With Quote
Old 08-03-2011, 09:40 PM   #5
HELP ME PLS!!!
 
Gachinto's Avatar
 
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."
Gachinto is offline   Reply With Quote
Old 08-03-2011, 10:51 PM   #6
HELP ME PLS!!!
 
Gachinto's Avatar
 
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."
Gachinto is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -8. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
SEO by vBSEO ©2011, Crawlability, Inc.
Revscene.net cannot be held accountable for the actions of its members nor does the opinions of the members represent that of Revscene.net