Actionscript 3 :: Using The CurrentLabel Property?
Feb 18, 2011
I am doing a project in AS3. It is a simple "slot machine." When the handle is clicked there are three MovieClips that play starting at random frames and when clicked again they stop on a random frame.
Now, the part I'm having trouble with: I need AS to evaluate the three frames (using currentLabel) and if they match launch a function called playWin. If they don't match then nothing will happen.
I tried a standard "if" statement but the currentLabel property is tripping me up. I also don't know how to compare three statements. I've only had practice comparing two.
Novice Flash dev here. I'm having a bit of trouble passing the name of an existing MC on my stage to a new variable and then tweening it. I've tried everything I could find.Here is the set-up:
3 levels of question difficulty: Easy, Moderate, Hard. Each question is a seperate MC in the library.Each question has two strings of text: one normal and one altered.container_MC contains all of the questions.Inside container_MC each frame contains one of the question MCs along with a second MC called highlight.Each of these frames is then labeled with the difficulty of the question and the question number i.e. easyQuestion1.Highlight is a MC containing a box that surrounds the alteration. It is labled the same as the frame +"Highlight" i.e. easyQuestion1Highlight.Each of the highlight boxes has Alpha =0.Each frame also contains the variables that determine the correct answer and the difficulty of the question.NONE of the objects on the stage have been added dynamically with addChild (note the Novice portion of my intro :D).
On my maintimeline I have one instance of container_MC. If the player selects the correct answer the current frames highlight box changes from Alpha =0 to Alpha =1.
Setting the text property of a flex DateField makes the selectedDate property of that DateField go to null.I need to set the text property so that I can use a particular format (DD-MMM-YYYY).
Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).
So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?
What's the difference between selectedChild property and selectedIndex property? I read the documentation, both seems to be setting currect active accordion. selectedChild can be only used in actionscript, but other than this, what's the difference?
Can we put [Bindable] on functions/methods? I know that bindable is used to change the value of the source property to destination property. But not sure if we can use that for methods. why we cannot put/ if we can then what will be the outcome?
I have a class Inhabitant with a property skin which is of type DisplayObject.
Within Inhabitant I need to access the x and y properties of skin using this method:
this["someProperty"]; Rather than: this.someProperty;
This is fine with properties defined within Inhabitant but I'm not sure how I could do this for a property of skin. This obviously doesn't work but it might give you an idea of what I'm trying to do:
this["skin.x"];
The reason behind requiring this notation is that I have a function which I can parse a String though that will represent a property:
public function addTokenable(property:String):void { if(!isTokenable(property)) _tokenables[property] = true; }
And then a related getter that will return a representation of this instance of Inhabitant as a String:
public function get token():String { _token = "class:" + getQualifiedClassName(this).split("::").join(".");
I'm wondering if there is a way I can bind a flex property to flash property?, the flash property is inside a swc file created in flash with the Flex Component Kit for Flash Professional, I can manipulate the flash component as a regular flex component, but I want to bind their properties, is there a way?
I can only explain this by an example; so:I have 2 classes and one of them includes the other as a getter/setter property.I need the following code to return the same result:second.first.X = 1; //but it does not. ( ExpectedMethod() is NOT fired. )
My code is not working.. I want command_quiz (5, whatever number is chosen) to operate. The javascript is working fine with textinput for page numbers.
1) I created a MovieClip with some graphics representing a simple tab menu item
2) I created a class "Tab.as" which extends MovieClip and linked to the MovieClip from step 1
3) I used Component Definitions in the library to add a String property linked to the variable "icon": Label = "Icon", Variable = "icon", Value = "", Type = "String"
4) In my Tab.as class I put an [Inspectable] get/set property, icon: [Inspectable] public function get icon():String{ ... } public function set icon(val){ ... }
I get the following compile errors for both get and set functions: 1023: Incompatible override. 1021: Duplicate function definition. Why?
i am working in Air application in Flex3 , i need know how to set "selectedItem" Property when we have 2 values like(data and label) label property to combobox selection, data value for our input.In (selectedItem="{stylename}") stylename will have "data" value but i need to set that "lable" property as selected value in combobox.Like if stylename is "checked" then the ComboBox selected item need to be "Checked".How to implement this in flex.
I have an Application with modules. Every Module lives for itself. There are no shared events or something between them.In my modules there is a datagrid and with a contextmen¼, the details of selected data opens in a popup window.The modules are controlled by an loalEventMap and a presentationModel as usual.If i closed the popup immediantly and open it again, all works fine, but if i change some data in the popup, close it unload my module and loade the module again, open the popup again, mate throw the following error[code]....
This seems like it should be an easy one but I can't figure it out.I'm trying out a very simple class that, when created, loads and XML file into the class's property. I must be getting a basic concept tangled up here because I can see the XML coming in just fine in the handleComplete function, but the class property _result remains empty.What concept am I missing here?
I need to specify more than one condition for visibiltyvisible="{data.allow && data.open}"However, this gives the error "The entity name must immediately follow the '&' in the entity reference."I could use a function, but I'd like to know if it is possible to do this directly with different syntax.
I know there are a number of posts dealing with this issue. But, I'm still not understanding it.I keep getting a "1120: Access of undefined property CSSloader." in the following script:
url...I want this code to be able to remove af or bf if its touching ground. But I can't do that because "cant define property of bf" and af. And I need to have it outside the other functions because I will have alot of code otherwise.[code]
I'm programming in Flex Builder Burrito for an mobile application.I'm trying to get a variable from navigator.PopView()and i found the following site: adobe View and ViewNavigator On that page is written that you can get to an returnedObject:
The ViewNavigator will save this object internally, and the new view can access it from with the navigator.returnedObject property. The problem is when I want to acces the returnedObject flash builder doesn't seem to find that even the package isn't found.
I want to accomplish simply that MC 'Menue' follows MC 'SliderLeftVert_Panel'. I don't get it.I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference at SliderSlide/Move()
The MC 'SliderLeftVert_Panel' is linked to Class 'SliderSlide.as' below
I need to access the property Access inside of my class. Actually I can do this in my FLA Reader.Access, but take a look in onComplete function, this function try call Access, but nothing happen.[code]
I'm trying to add a name property to the xmlLoader object just as I have successfully done with the photoLoader object. When the last line of code is present the following error is thrown:
1119: Access of possibly undefined property name through a reference with static type flash.net:URLLoader.
I suppose this has something to do with the URLLoader not inheriting from Display Object like Loader does. Is there anything I could do to add a name property to this URLLoader?[code]...