ActionScript 3.0 :: Add Some Flags To Each Element Property
Jan 19, 2009I have an array of FileRefrence. When I loop through it I want to be able to add some flags to each element, something like this
[Code]....
I have an array of FileRefrence. When I loop through it I want to be able to add some flags to each element, something like this
[Code]....
I got this old code, that works. When I tried to compile, it gave many compile errors like
Code:
Error: access of undefined property foo
foo.core.searchButton.enabled = false;
^
for instance (changed the original for the sake of post size, it's so many errors like that with different foo's). So, I did grep the code and realized that there's no declaration of 'foo' in any of AS classes. None of foo-like vars are declared.
Then, I got the only movieclip file in src folder opened in Adobe Flash CS5 and there they are: all of those variables that hadn't declaration in code were names of button, text fields, etc in the SWF. Given that, I thought it was just some compiler argument I forgot to put, but I didn't find anywhere. I looked for alternatives but I wasn't successful neither...
Okay, very simple: there is an array containing 3 objects. Each object has a unique property called "ID" with values of either 1, 2, or 3One of the objects gets deleted.The objective now is to update the ID property of each object corresponding to the new array.length valueSo for example, the object with ID of 2 got deleted. The remaining objects in the array would each have ID values of 1 and 3 respectively.o the objective is to loop through the array and update the ID properties to 1, and 2 (instead of 1 and 3)
View 2 RepliesI'm thinking about using binaries as a sort of multiple flag but I can't quite get my head around it and haven't so far managed to google anything useful.What I'm talking about is something like this:Say you want to track the on/off state of four switches, each state would be represented by a binary like this:0001001001001000Then all combinations of these states is represented by another binary, eg:00101101110I guess what I'm a bit puzzled about is how to check the results. I can think of ways to get there but I'd like to know common methods, or simply the best way to do it.
View 7 RepliesI have three bar MCs next to three "flag" MCs. When the user puts the mouse on top of a bar MC, the corresponding flag MC plays a fade-in animation. When the user moves the mouse back off, the corresponding flag MC plays a fade-out animation.It works fine only when the user moves their mouse slowly over the bar MCs. Fast movements cause the flags to get stuck visible, and instantly hide without animation when the bars are rolled over.first by mousing-over slowly, then quickly. The code is on the bars and flags (however, the flags start with alphas of zero.)
View 2 RepliesI have a flash website, with two menu the main menu that loads by Loader class swf files with the respective content. And the secondary menu that changes the language of the site. How do u implement the action of having the site translation?
1)Passing params Load file.swf?langid=n then reading by loader info (this one is not easy to test since loading swf with params doesn't work in flash ide debug env.)or
2) on load complete cast the loader to a movieclip the accessng a main func with the task of translating the whole swf contents(the same func i should have at point 1)
I know that there is no such function as getElementByName in Flex but I also now that you can do this["object_id"] to get the element of the application u're in.What about getting an element inside another element?I've tried making element["id"] ? But in my try-catch it always runs the "catch" part..how do I get an element inside another element just having it's id in dynamically created string form?
View 2 RepliesI have flash where there is a link for song download. And, at the bottom of the flash I've a count, loaded thorugh flash vars which should increment everytime donload button is hit. Please let me know what approach should i take to do that. can i call a Java method on donload button which will insert a row in the table and and then get the count and render it to the count variable in my flash?
May be this extremely confusing. Here is a very similar example on how it is done. This is actually very similar to what i want to do. [URL] on this link there is count below which increments you hit the download button.
I've built a rather robust tooltip class recently that attaches and draws a single tooltip sprite to the root, then uses MOUSE_OVER to detect when it is over a tooltippable object, and shows the appropriate tooltip text. At the moment, I'm ensuring that any elements in my application which wants to take advantage of showing tooltips implement the ITooltippable interface, and expose a public getter, get tooltip().
[Code]...
Basically I have 14 text boxes, each box draws its content from an external txt file. Next to each text box is a button. I want the button to be either visible=true or visible=false depending on weather or not the text box has content or is "undefined" Here is what I have so far, and it's not working:[code] I would like a FOR loop to just run through the variables and check to see if any of them are undefined. if it is, then make the correct send button invisible.
View 8 Replies<root>
<function name="lala">
<metadata name="foo" />
[code].....
I am unable to access 2nd element and 3rd element (I can acces 1st element.[code]
View 1 Replieswhen I create an element with this method :
this["nodeValue"+i] = new TextField();
(surely in dynamic class )
then I want to change instance name of that element.when I trace this["nodeValue"+i].name.I got a different name for that element ! f ex : instance8 .how can I get "nodeValue"+i from my element and change that .is it read only ? I want to swap tow element's instance name !
for example :
this["nodeValue"+i] to this["nodeValue"+i+1]
I am having a problem with my drop traget. I have the ability to drop and duplicate multiple objects on a stage. I have a clip set up (canvas) which is used for if someone drops objects onto this it duplicates the dragged clip.
However the problem I am having is that if someone tries to drop an element on top of an already drop/duplicated element, it wont duplicate the new clip. Its like it thinks that the dragged clip is not over the canvas.
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).
View 2 RepliesLately 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?
View 0 RepliesCan 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?
View 1 RepliesI 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(".");
[Code]....
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?
View 1 RepliesIs it possible to get the id of a swf's containing element? I'm pretty familiar with DOM scripting, so any kind of reference to the swf would be fine. I need to initialize registration of the swf to an array in javascript
View 3 RepliesI put some UI component on the stage but i does not seen there but when i test the movie then i can see int the swf file
View 1 RepliesI have a reference to a XML node which is part of a bigger XML tree. Is there a way to get that elements next/previous sibling without accessing the parent and looking for it? Something like DOM's nextSibling would be what I look for. edit: Given that there is no natural way to do this with E4X, I'll just stick to the following (except that in my case, I'll store the actual index somewhere instead):
[Code]..
i want to access an Element of an XML. But somehow. i get null as the Result and that does not make any sense to me.
View 1 RepliesI have an XML string, I can use this to get a value of an element, where i is a counter: trace(xml.player.child(i));
But how can I get the XML element?
I have several animated movies (counties in Ireland actually) that when clicked animated up in size and display some information. I then have a button to the left that I would like use to animate the movie back to its original size i.e. close it. Thing is that I would like to pass the name of the current movieclip to the button and use it in a function. I had thought of using a switch statement but id need 26 of them for this function alone. Solving this would reduce my code a lot. My attempt is as follows:
[Code]...
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. )
View 2 RepliesI know how to get one element from the array. But I don't know let's say how to take 3 elements ( position 0,1,2). I don't know how to trace all the three together. I am getting errors all the time.
var myArray:Array = [1,2,3,4,5];
trace(myArray[0]);
trace(myArray[0], ?,?);
I have an array like this
public var dataAL:Array=[
{Kiv:"cash", jan:26,janTarget:28,feb:27,febTarget:26,mar:30,marTarget:32,apr:31,aprTarget:32,may:28,mayTarget:29,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40},
[code]....
Now if i want to access febTarget for cash how will i do it?
No matter what values of z-index I try, I cannot overlay my html div (or img) element on top of this flash animation (see top left corner)[url]...
View 3 Replies