ActionScript 3.0 :: Check When Certain Key Is Down?
Aug 26, 2010How can I check if, for example the key "2" is down?
View 2 RepliesHow can I check if, for example the key "2" is down?
View 2 RepliesSee [URL] Now there is a button called Answera, which when clicked should have a symbol (movie clip) called Check appear at the cordinated specified. Check exists in the libary (but does not have an instance name) and no where else on the stage. when I run this code I get: 1180: Call to a possibly undefined method Check. -> var rightCheck = new Check(); How is it undefinded if it exists in the libary?
View 7 RepliesThe following is my codes. This is still work in progress; so, you will see some functions with empty contents. Plus, this is my first Flex application; please bear with me. This is a quiz application that gets the questions and answers to each questions from a ColdFusion web service. There are three types of questions, True or False, Multiple Choice with single selection, and Multiple Choice with multiple selections. So, based upon the question type, the application would dynamically generate the appropriate amount of radio buttons or check boxes for the users to select. I got these working. The problem that I am having is, I am not sure how to check what the users have actually selected. In some other forums and posts on other web site, it said that I can use event.currentTarget.selectedValue to get the user selection. But when I actually do it, I got a run-time error saying, "Property selectedValue not found on mx.controls.FormItem and there is no default value." My question is, what do I need to do to capture the user selections?
[Code]...
This may go under the php section, but I put it here because it may have more to do with AS.
I currently have a flash file and a php file. The flash file sends a byte array to the php file and the php file creates a .jpeg from it.
I'm now looking for a way for the php file to tell the flash file that it's done creating the .jpeg so the flash file can do something else.[code]...
OK so I have an .FLV playing in a div container. After and only after the viewer watches the complete .FLV I want a feedback form to come up. Now, should I use flash for this or html? What actionscript would I use for this ? Event.complete if thats even a valid command.
View 10 RepliesIs there a way to see for example what code is behind a button if I just have the swf file?
View 1 RepliesIs there a way of check if seperate movieclips have the same frame labels within them so that you can do a comparison?
& if not gotoAndStop(1)
[Code].....
I have a dictionary with objects as keys. How can I check if specific object is available in the dictionary?
View 3 RepliesHow can I check if a SWF element on a page has focus?
In IE, onkeydown events are not detected in JavaScript if a SWF has focus but Firefox always detects onkeydown.
how can i simply check if a returned value is a number i.e, 12 , 12.5, 12.75
if (_myValue == [[NUMBER]])
{
fire()
}
Is there any way to check whether a key is UP?
View 6 RepliesIs it possible for me to check to see if I am running my application from the IDE or on a web page? Reason being is because I am currently building a video player and I have ads coming in every 2 videos, and at the start..I can bypass this if I am just developing the ap locally...
View 1 RepliesThis may go under the php section, but I put it here because it may have more to do with AS.
I currently have a flash file and a php file. The flash file sends a byte array to the php file and the php file creates a .jpeg from it.
I'm now looking for a way for the php file to tell the flash file that it's done creating the .jpeg so the flash file can do something else.
Here's my AS3 code:
[Code]....
Now I'm looking for a way for the php file to send some data to the flash file telling it it's done writing the .jpeg.
I had made a flash movie in Flash CS3 Portable in which I used a specific font.
I had to re-install Windows and when I tried to open the .fla the warning popped up saying that the font used is not available.
Although I re-installed all the fonts I had when I made the clip, the problem persists. I see over 300 fonts inside the Windows/Fonts folder but Flash doesn't see them all in the font listbox.
Does anybody know how to check which font was used (the warning message doesn't say) in order to try to install it again?
I have a var thats created in php.[code]...
How do I check it in as2? [code]...
I am trying make a movieclip pan across the stage on a set path, I have 5 buttons, when button 2 is clicked, the movie clip is moved to position 2, its moved on a timeline so a function starts playing the movieclip, on the timeline inside this movieclip there are conditions on specific frames showing where the the timeline stops, so when button2 is clicked a variable is created which is "label2" and the timeline stops on this point, as seen the the condition below[code]....
View 2 RepliesI want to unload a swf and have it removed from memory, I use 'unloadAndStop'. But how can I check if the swf / MC has really been removed?
View 2 RepliesI searched this a number of times, but I haven't found the answer was.I am new to scripting, so I am still finding what works and doesn't. So far I have added a number of variables in the engine I am creating. I want the player to click the button. Once press it will affect many of variables. The thing is I want to make the button unpressable if one variable is <= a number, lets say 100, and another term is true: number(_root.var2)/number(_root.var1) > 2).Here is what I have so far:
on (release) {
_root.var2 = number(_root.var2) + 1;
_root.var3 = number(_root.var3) - 1;
[code].....
i want to make a check button where you can put a tick or a cross in the box. is this possible?
View 3 RepliesI need held checking if an input is empty and or isNaN. I have read forums on this and tried to apply what i learned. when i run this scrip i get nothing from the trace, not even an undefined.
PHP Code:
on (release) {
if (!isNaN(ItemCost)) {
var Notify_txt = "Please enter a payment amount";
trace(Notify_txt);
[Code].....
Is there any way to see if a depth is already being used by a movieclip before assigning it to another movieclip? I have a game where there are hundreds of movieclips moving around on screen at the same time and changing depths every time they move. But at rare times, one movieclip will spawn at the exact spot another movieclip is in and use that depth, making the old movieclip invisible (but still active and moving around).
View 2 RepliesIs there a way to Check if the xml file that your loading in has changed since you loaded it in last? I want to check to see if it has changed before i reload it into flash.
code:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("Data.xml"));
[code]....
I need to find the new item in a new set that is not in an existing set. here is an example:
// current set
{file, file, file, file, file}
// new set
{file, file, file, file, file, file}
- The current set contains a list of file objects (for example)
- The new set contains another set of file objects, however it contains most of the same files in the current set, but now includes a brand new file.The new file in the new set needs to be pushed onto the current set.
Restrictions:
- The new set cannot replace the current set, only the new file can be appended.
- The files cannot be directly compared because each file in the new set that references the same file as a reference in the current set is not the same instance. Therefore they need to be compared by property, in this case, teh file name.I have the general work out of the algorithm:
actionscript Code:
for each(var currentFile:FileInfo in currentSet) { for each(var newFile:LocalFileInfo in newSet) { if(newFile.name == currentFile.name) { }}
But i just cant work out how to extract the new file. I will get it eventually, but im kinda hoping that someone will find a better solution entirely. one that might not even require so many loops.
How do I check wheter KEY_DOWN is false on every key on the keyboard? (no keys are pressed)
View 3 Replieson enter frame i need to check if some mc contains a movie, if yes perform and action, if not do nothing ..
View 9 Repliesa simple question:How can I check, if a swf is embeded in an HTML-page or if it started indipendent?I need this to judge if I can use flashVars that were passed through the HTML code or have to use my internal default values.
View 3 RepliesThere are 50 movies loaded sequentially. From Q1 thru Q29 I want to attach a particular title (mc) to the main movie and then for Q30 thru Q40 another and so on. The file is on an Learning Management Sytem so I'm using SCORM [code]...
View 3 RepliesI am using a simple class that worked fine for a while. But today i used the color black (0x000000)When i used this, i did not see the fillcolor of the sprite.I noticed that 0x00000 = 0 and in an if statements is always false, so you never get in the trace output in this example.A color is of type uint, but i could use a Number and do a check for NaN, but that ditnot work also. Is it even possible to check whether a variable for a color is set? [code]...
View 5 RepliesI am having a set of movieClips in the my library with its linkage name. i have to save them in a array, and instance will be created later. before creating instance, i want to check whether given array value(linkage name) is exist in my libraray or not.
View 4 RepliesIn my submit form I want to check if either tF1, tF2, tF3 or tF4 contains any text in it. if yes to proceed.
This is my current code and how do I add the above to this?
if (my_vars.name != "" and my_vars.company != "" and my_vars.address != "") {
gotoAndStop(2);