The other thing is that i create all the elements on a formitem and a form before add to the stage so basically when i create the element i get the formitem name and the name of the element FormItem287.source_code_bt
so i dont get the whole object at all at the point of creation. =/ --- In flexcoders@yahoogroups.com, "Rafael Faria" <[EMAIL PROTECTED]> wrote: > > Johan, > > Thanks for your useful reply. > > I will try to work with the dictionary as well but i was hopping you > could explain me what does > > item.modelns::name.text(); > > mentioned on the article means. > > Sorry, i didnt work with this object before and i try to google it but > i didnt get nothing. > > > thanks > raf > > > --- In flexcoders@yahoogroups.com, "johantrax" <johan.temmerman@> > wrote: > > > > > Like if i create a <mx:TextInput id="foo" /> to work with it on the > > > actionscript just use foo.text = 'bla' for example. > > > > > The reason you can access foo in your AS here is because when you > > define an mxml-tag, it basically becomes a public, bindable property > > of that class. So if you want the same in AS it's sth like: > > [Bindable] > > public var foo:TextInput; > > > > > So, looking at this code and suppose that you CAN NOT change not one > > > line of this code, how do i work with "foo" in the myTimer function? > > If we CAN NOT change the code, there's no way to work with 'foo' in > > myTimer function (however as you pointed out yourself, you can test on > > the last part of childName of the last canvas to see if it matches the > > name of 'foo'). > > This is because you've declared foo inside the init-funtion, therefore > > it doesn't 'exists' out of the scope of that function. > > > > > The thing is i'm creating a lot of forms dynamically > > Great :) So do I, and I stumbled on a likewise problem. Not being able > > to reference the created objects. > > Even if you think to outsmart Flex and do like JJain said > > (object.id='myId'), the object won't be accessible by the use of that > > ID. The reason is that Flex/Flash generates the id of a generated > > object itself. > > There is a clean workaround for this problem using a Dictionary with > > the id's as keys and the objects as values. You can find an > > explanation about this method here: > > > http://www.jumpingbean.co.za/blogs/mark/flex_reference_components_dynamic_runtime_creation > > > > --Johan > > >