Don’t put the semi-colon in a binding _expression_ (though I don’t think it should be a problem).  Binding should take care of the class not being initialized yet (if you mean myActionscriptClass hasn’t been assigned to anything).  If the problem is that myActionsciptClass exists but getData() isn’t returning anything useful you will need to add a [ChangeEvent] to the getData() function and then dispatch that even to indicate it can fire.

 

This should address Ben’s comments too:

 

Binding and functions (by Matt Chotin)

 

When you use a function in a binding _expression_ binding will always look at the parameters to the function, and if any of the parameters changes the function will re-execute.  Additionally if the reference to the object that is holding the function changes we will re-execute (this is just like a property binding obviously). I don’t know if the docs mention it, but you can also add a [ChangeEvent] to your function.  When the instance of your class dispatches that event, we will also re-execute the function.  So if you have a function that you want binding to execute after creationComplete you could put [ChangeEvent(“creationComplete”)] on top of the function declaration.

 

HTH,

Matt

 


From: erik katerborg [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 14, 2005 2:40 AM
To: [email protected]
Subject: [flexcoders] beginners question about sending data to custom flex components
Importance: High

 

hi,

 

This may be a beginner's question but I just can't figure one thing out: how to send dynamic data to a custom flex component.

what I want to do is the following:

 

<myCustomSWC myDataToBeUsed="{myActionscriptClass.getData();}" />

 

the problem is that the function is not executed but simply passed as a string to the component. Another problem is that the actionscript class may not have initialised yet so the function would not work at all.

 

does anyone have a suggestion on how to do this ???

 

thanks very much !!!

 

a confused flex coder,

 

erik.

 

Erik Katerborg

<Multimedia Designer>

t: <050 - 575.78.88>
f: <050 - 575.88.89>
e: <[EMAIL PROTECTED]>
w: <www.thefactore.com>

<theFactor.e>
Friesestraatweg 215a

Postbus 2010
9704 CA Groningen

Business Partner for Mediasurface
Alliance Partner for Macromedia

 



Yahoo! Groups Links

Reply via email to