Hi, Keishichi.
I'm confused about why you're using that long dotted expression to get
to the image. You should be able to simply specify id="image1" on the
<mx:Image> and use that to refer to it; you would just write
image1.getStyle("fontSize"). (Also, what does the fontSize of an Image
do?)
The only time that you need dots is when you are crossing a document
boundary. If canvas1, viewstack1, panel1, and viewstack2 are all in the
same document as your <mx:Application>, you don't need any dots.
Dotted expressions like this within a single document (if that's what
you're doing) aren't recommended because they're inefficient, create
fragile code that must be revised when you change the visual hierarchy,
and won't work in Flex 2.
- Gordon
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of keishichi2001
Sent: Thursday, October 27, 2005 3:29 AM
To: [email protected]
Subject: [flexcoders] Re: set Effect at runtime
Actually, 'viewstack2' has defined as following.
<mx:ViewStack id="viewstack2" width="100%" height="100%"
selectedIndex="{ModelLocator.currentPageNum - 1}" >
<mx:Canvas id="cv_1" width="100%" height="100%" >
<mx:Image x="0" y="0" source="assets/img01.jpg" moveEffect="b" />
</mx:Canvas>
<mx:Canvas id="cv_2" width="100%" height="100%" >
<mx:Image x="0" y="0" source="assets/img02.jpg" moveEffect="b" />
</mx:Canvas>
...
</mx:ViewStack>
Therefore your recommendation would pick one of <mx:Canvas>, not
<mx:Image> that I really want to pick and change the moveEffect at
runtime.
Anyway, i tested your recommendation with changing "moveEffect" to
"fontSize" which is very style property.
and I got correct answer.
Also I set "fontSize" property on the <mx:Image>, and tried with
following code.
mx.core.Application.application.canvas1.viewstack1.panel1.viewstack2.sel
ectedChild.childDescriptors[0].getStyle("fontSize");
It returns 'undefined'.
I presume my reference to the <mx:Image> might be wrong...
Shouldn't use '.childDescriptors[0]' ?
Could you please let me know how i should pick <mx:Image> correctly...
Best Regards,
Keishichi
--- In [email protected], "bhaq1972" <[EMAIL PROTECTED]> wrote:
>
> > trace
>
(mx.core.Application.application.canvas1.viewstack1.panel1.viewstack2.s
> electedChild.childDescriptors[0].getStyle("moveEffect");
> >
>
> shouldn't that be
> trace
>
mx.core.Application.application.canvas1.viewstack1.panel1.viewstack2.se
> lectedChild.getStyle("moveEffect")
> ??
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/