Sherif Abdou escreveu:
I am not sure but you can have the x={this.unscledWidth} so that will
always update and do what you want. I think.
----- Original Message ----
From: jovialrandor <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, January 16, 2008 11:48:56 PM
Subject: [flexcoders] Re: Move effect
how does the 'component.width+ Application. application.
unscaledWidth' work?
i do not know the screen resolution, so i would like it so I do not
need to speciy an exact x,y coordinate.
eg.
if screen size is 1028x768 or 1600x1200, the component should move off
the screen.
take a look at this image description of what I'm trying to do.
http://thedarkcity. ws/transition. gif
<http://thedarkcity.ws/transition.gif>
let me know if i need to further clarify.
thanks
--- In [EMAIL PROTECTED] ups.com <http://ups.com/>, Sherif Abdou
<[EMAIL PROTECTED] .> wrote:
>
> you could just use i guess (component.width+ Application.
application. unscaledWidth) and that should take it off the screen, i
have no idea what the apple Ipod menu does so...
>
>
> ----- Original Message ----
> From: jovialrandor jovialrandor@ ...
> To: [EMAIL PROTECTED] ups.com <http://ups.com/>
> Sent: Wednesday, January 16, 2008 4:20:04 PM
> Subject: [flexcoders] Re: Move effect
>
> What I am trying to accomplish is the Apple Ipod menu for Flex: Sliding
> out/in menues.
>
> --- In [EMAIL PROTECTED] ups.com <http://ups.com/>, "jovialrandor"
<jovialrandor@ ...>
> wrote:
> >
> > How can I specify any Flex component to move out of the screen if i
> do
> > not know the screen resoluction of the end user beforehand?
> >
> > Is there some Move value like '-1' that indicates to move out of any
> > size screen?
> >
> >
> > Thanks
> >
>
>
>
>
>
> ____________ _________ _________ _________ _________ _________
_________ _________ _________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo. com/r/hs
>
------------------------------------------------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>
__________ NOD32 2799 (20080116) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
What do you need the screen resolution for? Unless you could make sure
the app is always fullscreen (wich you can't) the screen resolution
would almost always be different from the application size.
What matters to you is the application size. And you can easily get that
value (as Sherif said, component.width+Application.application.width).
Then you just have to trigger a Move effect (by AS or transition):
<mx:transitions>
<mx:Transition fromState="inScreen" toState="offScreen">
<mx:Sequence>
<mx:Move target="{component}"
xFrom="{component.x}"
xTo="{component.width+Application.application.width}"}/>
</mx:Sequence>
</mx:Transition>
<mx:Transition fromState="offScreen" toState="inScreen">
<mx:Sequence>
<mx:Move target="{component}"
xFrom="{component.x}" xTo="{0}"}/>
</mx:Sequence>
</mx:Transition>
<mx:transitions>
Now, you need to make sure the component gets off the screen AND it
stays there if the application is resized. There are a few ways to do
that, I'll tell you how to do it with Binding.
First, the Binding only should be set when the component is off the screen:
<mx:transitions>
<mx:Transition fromState="inScreen" toState="offScreen">
<mx:Sequence>
<mx:Move target="{component}"
xFrom="{component.x}"
xTo="{component.width+Application.application.width}"}
*onTweenEnd="bindX()"*/>
</mx:Sequence>
</mx:Transition>
<mx:Transition fromState="offScreen" toState="inScreen">
<mx:Sequence *effectStart="unbindX()"*>
<mx:Move target="{component}"
xFrom="{component.x}" xTo="{0}"}/>
</mx:Sequence>
</mx:Transition>
<mx:transitions>
Now the actual binding:
private var watcher:ChangeWatcher;
private function bindX():void {
watcher =
BindingUtils.bindSetter(_applicationWidht,Application.application,"width");
}
private function unbindX():void {
if(watcher!=null) {
watcher.unwatch();
}
}
private function set applicationWidht(value:Number):void {
this.x = component.width+Application.application.width;
}
And that's it. I didn't test this but I think it's at least enough to
show you a way.
Hope it helps, regards
Frederico Garcia