Copy link to clipboard
Copied
Hello Community!!! so i searched for something but i can't found anything!!!
so i have a button... and that button when you are pressing it you ar go to an another frame... but when you will press it again it will go back to the first frame!
so cause i have an error with "FadeSymbolIn" code that when you are going to frame and pressing too early the button to go back... the Flash Player 11 show me an error.... and the Alpha on this frame is going to 2 from 1.
so i want when you are pressing the button and going to a new frame to can't press other button so early... but for example to be freezed for 1 second!!! i want something like that!!!
Please help me if you can! i will be very glad for your help! i am new o flash and don't know too much!!! And sorry for my bad English!!!!!
If you want to time/delay sometrhing happening, then you have a couple choices for timers. The simplest is to use the setTimeout() function.
var sto:Number = setTimeout(delayedFunctionName, delayTime);
function delayedFunctionName(){
// whatever you execute here will happen after the delayTime passes
}
The delayTime value is specified in milliseconds.
The other option is to use the Timer class which is a bit more involved since it uses a Timer object and an event listener/hand
...Copy link to clipboard
Copied
If your code is giving you a problem you need to show the code and the error(s) that you get.
Copy link to clipboard
Copied
i don't have any problem on swf...
only on Projector i have this error...
i think is a flash player bug!!! not any wrong code on my script! but take a look!!!
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at FinalVersion_fla::MainTimeline/fl_FadeSymbolIn_18()[FinalVersion_fla.MainTimeline::frame19:160]
the frame doesn't matter... it will be to all the frames if i will press the buttons too quickly...
and the code that gives the error is:
OSRAM_popup.addEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn_18);
OSRAM_popup.alpha = 0;
function fl_FadeSymbolIn_18(event:Event)
{
OSRAM_popup.alpha += 0.1;
if(OSRAM_popup.alpha >= 1)
{
OSRAM_popup.removeEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn_18);
}
}
is flash player bug cause on swf file i don't have this error when i press the button too quickly
Copy link to clipboard
Copied
don't have any solution about my question or my error?!!!
Copy link to clipboard
Copied
No I do not !!!!
I don't see anything in the code you show that would produce the error as long as the line you highlighted is line 160 of frame 19, and all of the rest of that code also lives there.
If you believe this is a Flash Player problem and not a coding problem then you should ask for help in the Flash Player forum:
http://forums.adobe.com/community/flashplayer/using_flashplayer
Copy link to clipboard
Copied
man... thank's for your help but the only i exactly want is a timeout timer for the frames....
so when you are pressing a button and going to anther frame, everything will freeze for 1 second...
with that code i will avoid that bug...!!! cause is an effect error... and if you will not press buttons too quickly, you will not have any problem!!!
Copy link to clipboard
Copied
If you want to time/delay sometrhing happening, then you have a couple choices for timers. The simplest is to use the setTimeout() function.
var sto:Number = setTimeout(delayedFunctionName, delayTime);
function delayedFunctionName(){
// whatever you execute here will happen after the delayTime passes
}
The delayTime value is specified in milliseconds.
The other option is to use the Timer class which is a bit more involved since it uses a Timer object and an event listener/handler function. You should be able to find how to use that if you check out the help documentation or search Google.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now