New Flex Component: RandomWalk
June 28th, 2006
In honor of the release of Flex 2, I’ve posted a new component that I built last week with a couple other developers from the SDK team. This component is a nice example of how you take a basic idea and turn it into a full featured, skinnable, stylable, templated reusable component.
Check it out here, then come back and let me know what you think.
June 28th, 2006 at 4:54 pm
great work!!!
June 28th, 2006 at 11:05 pm
thanks so much!
June 29th, 2006 at 5:12 am
I get this error when trying to view any of the demos.
ReferenceError: Error #1069: Property hasDefinition not found on flash.system.ApplicationDomain and there is no default value.
at mx.managers::SystemManager/getDefinitionByName()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::addingChild()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()
at mx.managers::SystemChildrenList/addChild()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()
at mx.managers::SystemManager/::initHandler()
June 29th, 2006 at 6:19 am
That’s a pretty slick component. I’m definitely going to have to spend some time with the source for this one.
June 30th, 2006 at 11:28 am
Ely, looks like the icons for the icon walker are not included in the source.
July 6th, 2006 at 11:02 am
I’m getting an error on compile in Flex Builder 2.
AnimatedRandomWalk.as
line 291
private function initializeLabelTarget(target:LayoutTarget):void
I tried to compile the IconWalk.mxml
July 10th, 2006 at 3:35 am
is it possible to implement the forward button as well as the backbutton?
July 11th, 2006 at 10:59 pm
hrlddqupdk…
smbqnrma ocjmcaqeu mvjmvmqxuc…
July 13th, 2006 at 11:27 am
[...] At EUI we’re building an application that uses a Flash-like model of pulling symbols from a library and dropping them on a stage. While architecting the core components of this system, it became apparent that each symbol would need to have several different view states, e.g., selected, dragging, dragged-over, etc. Flex 2 has a introduced a rather elegant way of defining and applying view states, but I have only seen it implemented using MXML. As a long-time Flash developer, I’m still a bit unclear on how to best use MXML and Actionscript together in one component, although the RandomWalk component that was demonstrated at ACDS has a really good example (see IconItem.mxml in the source). Reviewing the example again, I think I could figure out how to make my symbol component an MXML component and still utilize the Flex invalidation mechanism, however when I first started, I couldn’t get my head around this. Anyway, it became a mission to figure out how to use view states in an Actionscript only component. [...]
July 13th, 2006 at 11:16 pm
well….it definitely rocks!
Best regards,
Iuliu
August 1st, 2006 at 1:47 pm
This is a great looking component but I’m having trouble getting Flex to open and run it. I’m new to Flex (I’m a Flash user) so I am probably importing it incorrectly at least that is my guess. Is there some trick to getting this into Flex? How are the rest of you doing it.
Thanks
August 2nd, 2006 at 8:41 am
Now I gotten this to the point I only get a 1046 error. What is that in relation to this particular component?
August 10th, 2006 at 3:24 am
Hi
Ive been checking out this component and I love it. So, Im using it right now, adding a few extra features, like drag and droppables. But Im stuck on that, cause when I drop something in the “tree”, it doesnt get updated automaticly. The view does update however when I start navigating in the tree. So my question is: is there some kind of reDrawItAll() function? Or do you have any other suggestions?
Thank you…
August 15th, 2006 at 11:24 pm
problem solved, I adjusted the commitProperties method…
August 28th, 2006 at 5:51 am
Can you tell, how one could implement the clipContent property?
while trying to include the RandomWalk into a container, it doesen’t get clipped, neither the container does not display any of its scrollbars.
August 28th, 2006 at 1:42 pm
Containers are optimized to only perform clipping when they think they actually need clipping (since there’s a cost to the clipping even if everything is visible). So my guess is that what’s happening is that the container doesn’t think the RandomWalk component needs to be clipped. Which in turn means the container is probably telling the randomWalk to be one size, which the RandomWalk is ignoring and drawing at it’s own happy size.
So you’ll need to do one of the following:
1) edit the randomWalk updateDisplayList function to only draw what it can fit in the size (unscaledWidth, unscaledHeight) given to it.
2) override measure() in randomWalk and have it calculate its measuredMinWidth and measuredMinHeight values. If those represent the size the randomWalk needs to render, the container should never try and make the RandomWalk too small, instead opting to clip it and/or show scrollbars.
Ely.
October 18th, 2006 at 8:46 am
Great job and kudos to you for making these and all your works available. A commendable and generous contribution to the Flex development community.
BTW, was thinking how random walk could be used to reflect an organization tree by changing orientation to be top/down rather than left/right. Using the icon example, staff pictures could be used, etc.
Thanks again.
Have any advice where to start in adapting your code?
November 23rd, 2006 at 12:46 am
Hello Ely, great work with all your components, i’m very impressed by your talents! Maybe can you explain wy you didn’t include the RandomWalk Icon Browser into your available resource? Or maybe i’m to rookie to understand some hidden things in the RandomWalk component behavior :-) …
I’m learning a lot of things reading from your work, many thanks again. !!!
March 4th, 2007 at 4:27 am
GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!! GOD OF FLEX !!!!
THANK YOU VERY MUCH… I LOVE YOU WORK !!!!
March 9th, 2007 at 2:31 pm
Wow!
Up to now we wanted to implement a simple tree…..
March 14th, 2007 at 2:39 pm
Hi !
Подскажите,какой вид рекламы эффективнее и почему? раскрутить нужно сайт и объявление с телефонами Менеджеров по продажу.Плизз,помогите советом!!!
Заранее спасибо всем кто ответит
March 27th, 2007 at 12:25 pm
Mr.Greenfield, I was wondering if you could explain how I would add this awesome flex component into a pre-existing flex project I have going… What would I need to do to use this on a page I’ve built?
Thanks.
April 23rd, 2007 at 6:56 am
Great component (by the looks of it) but I too am getting the 1046 error - can you post some advice on how to get around this:
1046: Type was not found or was not a compile-time constant: LayoutTarget
Or simply on how to implement the componenet?
May 30th, 2007 at 7:55 pm
Dude, awesome work man. Thanks for sharing with the community. As someone just starting out with the Flex SDK (too cheap to buy flexBuilder) this is some great inspiration.
And on another note (since I saw some images of the Corel Centre) go Sens go.
June 26th, 2007 at 11:09 pm
I’ve been playing around with this component for a while now… but I can’t seem to figure out which child is currently selected. i.e., if I click on “Food”, I want to know by maybe even a simple string that “Food” is currently selected.
As of now, I’m trying to find a good place in the code to set a currentNode to the currently selected node, but can not seem to get it working.
Maybe I’m just blind?
June 26th, 2007 at 11:09 pm
I’ve been playing around with this component for a while now… but I can’t seem to figure out which child is currently selected. i.e., if I click on “Food”, I want to know by maybe even a simple string that “Food” is currently selected.
As of now, I’m trying to find a good place in the code to set a currentNode (string) to the currently selected node, but can not seem to get it working.
Maybe I’m just blind?
September 6th, 2007 at 2:38 pm
Ely,
If you have a moment, you might want to check out our Derby submission which has a graph layout called hierarchical - similar to random walk.
The air app is available at:
http://flexvizgraphlib.googlecode.com/files/BirdEye.air
October 7th, 2007 at 3:46 pm
Ely, how do I attach a click event to the Random Walk? I want to be able to take the xml selecteditem attribute to pass into an URL.
Thanks!
(ps. Your work is amazing)
November 8th, 2007 at 10:08 pm
RE: RandomWalk…I really like the UI possibilities with this components, but would like to update it to fit a more current model of the possible data types & events that I would need it to handle. Specifically, I would like it to be able to take ArrayCollections of objects (in addition to XML) in the same way a tree collection can take multiple hierarchical data types. I am interested to see how you think it would be best to approach this I would love to just be able to extend the component over riding some methods, however do you think instead I would need to start for scratch rewriting it for those purposes. Thanks. - k
December 8th, 2007 at 12:58 pm
UPDATE & QUESTION:
I have modified this code for our purposes and for the most part have it working. It accepts and ArrayCollection as a DataProvider and we added drag and drop to the renderer so we can interface with other components. At some point I would love to fit this into some of the existing Flex architectures so that I can use it a little more broadly, but I think that will take a little more learning on my part. I made an attempt at implementing the TreeDataDescriptor as you suggested, but found it a little too much work for what I needed right now.
I am having one strange problem though. I have decided to nest this component inside a Panel container, but I am finding that if my dataProvider gets large and thus the node instances extend higher that the height of the component, they display on top of the parent Panel component instead of getting clipped/masked as I would expect from any child container of Panel (clipContent = true by default). I am wondering why these instances are being drawn on top of everything. I looked at the code and it appears the drawing is being done in the _lineSprite (Sprite) which is added as a child to the component. Any insight would help since I would think the desired behavior of most components is to have them cliped by parent containers. Thanks for the help. I would be happy to send you my version of the code although it is not really “production ready” for anyone else except our uses.
January 24th, 2008 at 7:51 pm
Kevin, would you be able to post an example for us to see? wonder where Ely is. It’s been a while since his last response.