FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Fast Clicking Freezes the Application!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Flash Shockwave
Author Message
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Fri May 11, 2007 2:05 pm    Post subject: Fast Clicking Freezes the Application! Reply with quote

Guys,

I am back with an entirely new problem Sad (i am currently working on 3 different flash projects, and this is for one of them). The Flash file that I am creating right now is a Tutorial that explains how to use a particular software. So the file as such has about 100 different steps! So each time the user clicks on the next button a new step comes up. (And I have about 12 different scenes in all. So clicking on the next button takes you to the next scene if the user has viewed all steps in a particular scene).

The way I have done this is by using a Switch Case under the on (release) part of the next button. As you can imagine certain Switch statements have upto 35 cases! Everything works well if you keep clicking the next button at a normal pace. But if you just want to get to particular step by clicking the next button rapidly, the file freezes! It just goes to this one page and the page keeps reloading and I cant even close it. I have to quit the player and re-run the file.

Sorry about the really long message. But I wanted to make sure I was clear. Does anyone know why this is happening? I can try and post the file for someone to take a look, but unfortunately it has confidential material and so I would have to edit the contents before I post it. Please let me know.

Appreciate your help!

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 728

PostPosted: Fri May 11, 2007 3:30 pm    Post subject: Reply with quote



it could be run time execution of the switch statement. Please post the fla if you could (do edit it before hand).

My other suggestion is: to allow user to input slide number such as 22/35 , 33/35 etc. In this case users can go straight to the slide and it isn't too hard to implement too, i suppose.

Back to top
indogo
fourth grade


Joined: 03 May 2006
Posts: 223

PostPosted: Sat May 12, 2007 2:14 am    Post subject: Reply with quote

Flash can be a pain...I'm trying to get clip loading detection working consistantly and am failing miserably Evil or Very Mad

To make a tutorial you may save yourself a headache by using
http://www.debugmode.com/wink/

outputs in flash...free as far as I know and built for the job

mike

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 728

PostPosted: Sat May 12, 2007 11:30 am    Post subject: Reply with quote

that's a cool tool mike! I was looking for such tool too, heheh.

cheers

Back to top
indogo
fourth grade


Joined: 03 May 2006
Posts: 223

PostPosted: Sat May 12, 2007 8:30 pm    Post subject: Reply with quote

'It's a kool tool,
and I'm no fool'

my rap of the day Very Happy

Back to top
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Sun May 13, 2007 12:32 pm    Post subject: Reply with quote

Mike and Guitarman,

Thanks for your responses. Actually, I was sort of wrong about the description of the problem. I checked it again and there 'seems' to be no problem with the scenes where I've used the Switch statements.

This is the link to the edited version of the file (this contains just the 1st few pages). http://www.mediafire.com/?emzimtw0td1

To check the problem please do the following:
1. click on the table of contents
2. click on topic 3
3. if you click the next button once there is no problem. click it rapidly (twice or three times) and you will see how that messes up everything.

My feeling is it has to do with the code that am using. Which is:
on (press) {
MC_Title.gotoAndPlay(16);
var interval:Number = setInterval(function () {
gotoAndPlay("Stages", 1);
clearInterval(interval);
}, 1200);
}

Please let me know what you guys think. As always, i can't thank you guys enough for your help Smile And mike, Wink is a great tool - i wish i had known about it earlier!

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 728

PostPosted: Sun May 13, 2007 2:43 pm    Post subject: Reply with quote

what is your gut feeling of using setinterval inside the On Event? in other word, why would you code it that way?

May be we can modify the code to make it work the same way as you want, u know.

Back to top
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Tue May 15, 2007 5:56 am    Post subject: Reply with quote

Guitarman,

I used setInterval for just one purpose - basically when the user clicks on the "next" button, I want the "topic" to slide all the way to the right (from its middle position) before the next scene is loaded. If I dont put a setInterval, when the user clicks the "next" button, the control would immediately shift to the next scene. I am sure there is a better way to do this... I hope this is clear.

Thanks a lot guys!

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 728

PostPosted: Wed May 16, 2007 12:16 pm    Post subject: Reply with quote

what i think is this: when user clicks on next button, just put gotoAndPlay(16); and on the last frame of the first scence, put the gotoAndPlay("stage2").

The idea is to avoid using the setinterval alltogether.

You may try and see if it works. In doing so, you may wanna add additional script to the last frame of stage one to fix your issue.

I sometimes hardly find solution without seeing the .fla itself and hope my input get you to think of something else.

Back to top
indogo
fourth grade


Joined: 03 May 2006
Posts: 223

PostPosted: Thu May 17, 2007 9:06 am    Post subject: Reply with quote

Similar sentiments...

perhaps disable the buttons until the slide across is complete.

looks neat so far

mike

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Flash Shockwave All times are GMT + 8 Hours
Goto page 1, 2  Next
Page 1 of 2



by phpBB