If I have a Global Variable Globalvars.vars.noLoaded which is in many classes How do I create an event where i detect to see if it reaches a certain number.
I'm trying to duplicate a movie clip when a variable reaches a certain number.. this is the code I used... if (numBlts<300) { _root.power = 1; _root.p += 1; duplicateMovieClip(_root.plus, "plus"+p, p); } The problem is that I just want to duplicate it once everytime numBlts gets below 300. After numBlts increases above 300 and then goes below 300 I want the clip to duplicate. All its doing now is duplicating infinite times...
I'm trying to create a game for a class project, using Flash MX. Unfortunatly, I am unable to figure out how to goto a new scene when the score reaches a certain number.
The ActionScript for it is...: //hit _root.total = _root.total + 100 //miss _root.total = _root.total - 50 [Code] .....
I've even tried using ""'s around 'score' and other things, but still no luck. I still havn't figured out the stupid timer either...
I try to create game Guess Number using classes...On .fla file i'm planing to have components like Button and TextInput from flash components library.Also i created GuessNumber.as with class GuessNumber.
I'm trying to think of an AddEventListener...When a timeline animation is playing, and it reaches a certain frame, in which the event listener would listen for.
i am trying to create a timer that when it reaches to the number 10 it changes the text in a dynamic text box, i have got the timer counting but when it gets to 10 it doesnt do anything.here is my code:
Code: stop() cooltimer.text = "0"; var myTimer:Timer=new Timer(1000,0);[code]....
if I have an event listerner (mouse, keyboard, enterframe,....event) that is being triggered, and when it finishes its event, something that is able to detect the finished event listener and fire out another sets of event.
It works more like MOTION_FINISH in TweenEvent, but it is only available for TweenEvent only, what if I want to detect a mousclick, keyboard, enterframe or even touch event?
What I want: an application that detects the calling phone number on a standard phone connectionLet's assume that the line has caller ID enabledI'm not sure where to start with this one!!Amongst other things, I need to take a standard phone line and route it through my PC some howThe end application developed will be in Flex - but first, I need to solve this part
I have a movieclip placed in the main timeline. Inside that movieclip, there is another movieclip.I need to know the current frame number of the inner movieclip when the animation is playing.And report that current frame number back to the actionscript in the main timeline.
I'm loading some text from a xml into flash. Now for each piece of text needs to be a Click event. So if i click on xmlData.location1 i need to go to the info about location1. If I click on xmlData.location2 i need to go to the info about location two. See code blow.
Code: public function HotelLocations(){ LocationsLoader.load(new URLRequest("hotellocations.xml")); LocationsLoader.addEventListener(Event.COMPLETE, onComplete);
I have 1 button that when pressed 1 time should play "movieclip 1" and when hit for the second time should play "mc 2" on so on untill "mc9"(each movieclip plays continously when once activated)
so I need the button to register how many times it has been activated to play the right movie at the right time
I know I saw a script once that would work sometime, just cant find at anymore
I've been trying to detect the number of lines used in a dynamic textfield without any luck. I have tried using the scroll property of a field which didn't work (Find my attempt attached)
I need to create a script that will jump to a certain frame in the scene when a movie cilp reaches its last frame. Putting a goto... within the MC itself doesn't work. I assume that I need to create a listener of some sort....I haven't been able to find what I need in any documentation (and I'm even been looking through AS dictionaries going back to Flash 4).
This one is for all the TextField wizards out there. I have a text field that displays 2 paragraphs of texts. The first one I want to be truncated to show only 3 lines of text maximum. The 2nd paragraph is to be appended to that text.
Is there a way I can show only the first 3 lines of the first paragraph? Think of it like an abstract for an article for the first paragraph.
I tried doing it with String.subStr(0, guestimate of 3 lines of chars) but it's pretty inconsistent in that some strings will take up 4 lines of the textfield.
I thought about doing 2 separate textfields but in the case of the first paragraph having only 1 line worth of chars, there will be gap of 2 lines worth of chars between the 2nd paragraph.
with the following problem:I have 1 button that when hit 1 time shouldplay "movieclip 1"when hit for the second timeplays "mc 2"on so on untill mc9(each movieclip plays continously when once activated)
In the KeyboardEvent object I get on key-down events, is there a way to know if the event is the first key-down, or a repeat when the key is held down? I want to toggle a setting when a key is pressed; I could listen to key-up but I'd prefer the action is taken as soon as the key is pushed... as long as I can stop it toggling back and forth as the key-down repeat events are generated.
I like to move textfield 1 when I press left or right arrow keys, but I also want to move textfield 2 when I press space while textfield 1 is moving like...an airplay game (you can shoot a missile while you're moving).
I really like to post my source code...but I actually have no idea where to begin.
the following code moves textfield 1 when I press arrow keys...
my code snippet:
private function keyHandler(event:KeyboardEvent):void { switch(event.keyCode) {
In my application, I need to detect a CTRL-C event. I can detect CTRL-K , CTRL-T , CTRL-U, and a bunch of others, but it seems that CTRL-C is reserved ! First it detects the CTRL , but as long as the CTRL button is held down, it totally ignores C when it's pressed. I know that there was a key combination detection script here on kirupa offered by someone (Michael), but it has this problem as well. how I can detect this combination?? Here is the code Im using to test which key is being detected (Note that debug is the variable name of a textfield on the main timeline, because testing key combination events inside of flash sometimes causes problems):
I use OSMF's SWFElement for my project to load SWF file in to main Application but the main app can't detect event from child SWF at all, .CODE in the Main App
mediaPlayerSprite = new MediaPlayerSprite(); var swfElement:SWFElement = new SWFElement();[code]....
CODE in the Child Flash SWF using Flash CS3 add code in The FLASH TimeLine
The change event seems to only throw when using the calendar pop-up. It is not thrown when the user manually types in to the field. I also tried dataChange.
I'm using a keyboard event to detect when a key is pressed. This is what it looks like:
Code: private function keyPressed(event:KeyboardEvent) { switch(event.keyCode) { case Keyboard.CONTROL: ctrlHandle=true;
[Code]...
It's worked up until now. I know that all the keys except the last one work because they carry out their function and the trace on DOWN works. However, for the last one, I've tried W and ALTERNATE (and got errors) and ESCAPE and TAB (both not doing anything, not even returning the trace).
I'm trying to know if mouse of the user is over my video when the status of the netstream video is "start". I don't understand how.
Code: Select allns.addEventListener(NetStatusEvent.NET_STATUS, netStat); function netStat(event:NetStatusEvent):void { switch (event.info.code) { case "NetStream.Play.Start":
Here I would like to detect the mouse position or event. (something like : if mouse over >>>> play with sound >>> else >>> play without sound. break; }}