Actionscript 3 :: Inject A Dictionary Using Parsley Framework In It?
Aug 29, 2011
In my parsley container, I'm instantiating an object 'A' that contains a Dictionary (flash.utils.Dictionary).
I would like to create this Dictionary using parsley and inject it to 'A'.
This dictionary pairs structure is: key=id of object 'B', value='B'
where object 'B' is also an object which is defined and created using parsley(so basically the pairs structure is and object id as a key and the object itself as the value).
Now, I have no problem creating 'A' and 'B', but can't seem to find the right way to create this dictionary using parsley, nor injecting it to 'A'.
I am trying to use parsley framework in my flex application. Messaging System is one of the best feature that I see while using parsley, But I had a doubt, Does using Parsley framework in your application means that
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{ var id:int; var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
I have a controller that receives an event with some data. As a part of the processing this s new data it needs to modify a collection in another controller. Is it a bad idea to inject a controller into another controller to modify this collection?
I was wondering how do you inject metadata into an f4v file with quepoints? I've been reading somewhere that it's either during encoding or a custom actionscript that embeds when the file runs.
Is it possible to inject data, for example a collection of assets (video, images...), in an swf at compile time?
We have a flex application that needs to be able to export an swf at runtime that contains all the necessary data, because it needs to run as a standalone application (on- and offline).
The idea so far was to create a server side script that calls the flex compiler and feed it the data it needs. This approach seems to work fine using the [Embed] tag for single files, but it gets kind of messy when trying to inject collections of data that vary in length for each exported swf.
We could generate an mxml file with one embedded variable for each asset and include it at compile time, but that approach seems for from ideal.
We've looked into some actionscript bytecode libraries, but those do not seem to be fit for this.
I was wondering wether it is possible to inject a frame script into a MovieClip and to get a reference to the mc the script was injected into from the function used as the frame script.There is a MovieClip named mc. It has a frame label 'end' somewhere and we want to add a stop() to that frame without adding code to the MovieClip itself (keep in mind that this is just an example). So here is the code (we could place it on the main time line of a test movie that has the mc on the stage):
var end:int=0; for (var i:int=0;i<mc.currentLabels.length;i++) { if (mc.currentLabels[i].name=='end') end=mc.currentLabels[i].frame;
[code]....
When the playhead reaches the frame labeled "end" in mc the function doStop() will execute. This function keeps its original scope however. So to stop the mc we need to specify mc.stop(). 'this' points to the object where the function doStop resides so this.stop() won't work. If we wanted to use the same function for multiple mcs we'd have to get a reference to the currently targeted mc somehow.
Is it a bad idea to inject data into an itemrenderer. The reason I ask this is because the state of each item is dependent on different changing data sources. So the original data is used to just display a new item, but there could be two to three other data collections that would be needed to determine the item's behavior. Is there a better way to do this? Should I be creating a custom DataGroup with the other data sources as properties on this custom container and then reference the data sources from the itemrenderer to the parent?
With regular HTML it's possible to change the look of the page and to make new cookies using javascript simply by typing it into the address bar and hitting enter.But what about flash videos.Is there a way to preform some action on the video on the page using javascript in the address bar?
I'm designing a game where the levels are too big to be in one swf. so each level loads up a new movie- but if my wildest dreams came true i would be able to, for example, load level 2 and have it remember how well you did on level 1.is there any way to do this? to inject a variable from the first movie to the second one after it takes over?
I want to use the Parsley framework and I want to use GraniteDS for remoting. As of 2.1, GraniteDS generates AS3 service classes from your Java code as local proxies, and I want to use these classes in Parsley.[code]...
I am planning to start a new project in as3 and I want Dependency Injection in the project. I found that parsley and Robotlegs are two popular frameworks for implementing DI in AS3. Which is the best one among these two?
My main requirements are
lightweight minimal learning extensive documentation and active helping community
I needed some guidance on how to use FlexUnit 4 within Flash Builder,to unit test a Parsley-frameworked Flex application.I have tried lookign at one or two sites but with no avail.
I'm looking for examples of command chaining in Parsley. What I mean by command chaining is when one command returns a result that is then immediately used to initiate another command. I ask this question here because the parsley forums have been down for 2 days.
i'm looking for a possibility to log messages in my flex 4.5 Project. This should cover errormessages in remoteClasses, errorHandler or messages typing by hand. After reading a lot of webpages, the solution from parslay looks good. i want to switch to this framework anyway. the benefit is the possibility to configure the logging behavior at runtime. but i don't understand the documentation. perhaps because I'm brandnew in parsley. Also google has no fitting result.
I'm starting with Parsley and cannot manage to make the autowire working. My configuration is based on flex 4.5 and parsley 3.0.0. My application contains the folowing bootrap :
[code]....
The workaround is quite heavy as it requires adding in all my views the proprietary tags. what is wrong with my configuration?
i am working in a flex application, i have an mx text control or I can use whatever control I need to do display the text value, but what I am trying to accomplish is to be able to format that text value with html 'before' it gets bound to the text control.<mx:Text text="{data.combinedCriteria}" width="99%">In the .as file that manipulates the combinedCriteria property of data,
Normally in Flex you use a collection like ArrayCollection as the dataprovider for components. I often have data stored as a dictionary whose values I would like to use as a dataprovider.
I'm working with a large set of hierarchical taxonomic terms, where each term ("203") has a matching "term203" movie clip on the stage, and am having trouble getting a recursive function to return all of a given term's descendants.There is a main Dictionary() object with the following nested organization for each term:
...where the [object Movie Clip]'s instance name would be "term203". All of these object:subObjectArray items ("terms") are stored in a master taxonomy:Dictionary() object.I've been trying to make a recursive function (which is in itself already a little above my head) that takes the click.target of a movie clip and returns a new Dictionary() object with all of the children and grandchildren and great grandchildren (etc) of that term, in the same, nested organization described above.
The code below traces the right number of recursive loops, but the returned Dictionary() object only contains the first run's terms (only the immediate children of the requested term).
var taxonomy:Dictionary = new Dictionary(); // ...Term info is loaded into taxonomy from a JSON-style text file) // ...MOUSE_OVER event listeners are added to each
[code]....
I certainly do not claim to be the most efficient AS3 programmer, so I am open to alternative configurations. However, after trying static and nested Arrays, I would prefer to continue using the Dictionary() object as my main pool.As noted, only the immediate children end up animating in the revealChildren() function. It's mystifying to me then, that in the getAllChildren() function, all of the descendants trace sequentially (well in no particular order) in the output window.Also I can't get any sort of name or property out of the subSet Object. That could be the problem.I've only tested it as far as 'two generations,' but it seems that only the first round of calling the function successfully adds those terms to the new Dictionary() object and returns it intact to the animating function.
I'm often seeing others using a Dictionary object in their AS3 code that simply maps objects by String keys and wondering if there is any advantage at all of using a Dictionary over a simple Object if String keys are used. Anyone know any details on this? I would suppose that since an Object is more lightweight it should be faster and preferable over a Dictionary if used with String keys.
why the Dictionary class ignores setPropertyIsEnumerable? I found this bug at bugs.adobe, seems the prototype might be involved in some devious way.Here is some test code:
var obj:Object = { 'a': 0, 'b': 1,[code]......
Notice that the Dictionary is still enumerating the property "a" even though it was told not to.
What is the correct way to determine if a Dictionary contains a particular key or not?
In Java I can do: HashMap x= new HashMap(); x.containsKey("test"); // returns true/false Is this the correct way in AS3? var xictionary = new Dictionary(); x["test"] == null