Mark,

If the compoent is in memory then there is no way to call this function when
ever it is loaded( expect 1st time)

Now how to resolve this issue, it can be achived by action script

when ever u want this in memory u can use this function

public function onload():void
{
     // Thing u want to do,
      Alert.show('test')
}

in main application u need to attached the child to parent and then call
this onload function

like
MainForm.addChild(can);
can.onload();


<mx:Canvas id="can" xmlns:mx="http://www.adobe.com/2006/mxml"; width="912"
height="444" show="Alert.show('test')" >
Let me know if this is still a issue for u


Regards,
Paresh M. More
Software Engineer

Nashik/Pune, Maharashtra, India.
Email - [email protected]


On Tue, Mar 24, 2009 at 2:28 AM, Scott <[email protected]> wrote:

>    If I’m not mistaken, the component is created and kept in memory once
> you call it.
>
>
>
> I don’t think you can call the “show” the way you are trying to call it in
> the constructor.
>
>
>
> Instead you would have to do a creationComplete=”Alert.show(‘test’)”
>
>
>
> The re-calling the function would be dependent on what you are trying to
> do.  I believe you would have to create a function in your initializer
> function based on a timer.  Or at least that’s what I can think of off the
> top of my head…
>
>
>
>
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *markflex2007
> *Sent:* Monday, March 23, 2009 3:12 PM
> *To:* [email protected]
> *Subject:* {Disarmed} [flexcoders] How to make "show" event work?
>
>
>
> Hi,
>
> I have a mxml component and I want it run a function when it is loaded
> (not only first time),I did the following test for the component and I do
> not know why the show event never work.
>
> Please help me.
>
> Thanks
>
> Mark
>
> component code:
>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="912"
> height="444" show="Alert.show('test')" >
>
> ...
>
> </mx:Canvas>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
>
>  
>

Reply via email to