Thanks for the responses :) It's encouraging. I really don't mind states so much - I can do simple navigation with them and the odd transition (fades, resizes, etc.). Got my head around that -- enough to get into trouble, anyway.
What I can't figure out is AS3 and how to script a simple expiration alert with a button click. Below is my attempt that returns lots of errors. I mean, it looks good to me, but not to the flex compiler. I'd really like to learn this stuff, so any help with the proper syntax would really be great. I'm digging through the livedocs, AS3 cookbook and Essentials Flex 2 w/ AS3, but I've only one oar in this boat. <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.controls.Alert; public function Date() { var theDate:Number = new Date(); } private function alertListener():void{ if (theDate.getFullYear() >= 1933) { Alert.show("Expired!", "Alert Box", Alert.OK); } } ]]> </mx:Script> <mx:Button id="myButton" label="Test Expiration" click="alertListener();"/> </mx:Application> --- Tracy Spratt <[EMAIL PROTECTED]> wrote: > Further, use the Timer class to periodically run the > expiration test > logic. > > Tracy > > > > ________________________________ > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of > Alex Harui > Sent: Monday, April 02, 2007 2:37 PM > To: [email protected] > Subject: RE: [flexcomponents] Simple Expiration > Component > > > > Chris, going from Flash timeline to Flex is a bit of > a mental shift. > > > > If I were you I would investigate what we call > "states" which is > represented by the <mx:state> tag in MXML. There is > a .states array on > each UIComponent if you're coding in AS. > > > > Anyway, to some degree, if you used the timeline as > a state machine in > Flash (as opposed to an animation frame engine) then > you can create a > "state" for each of your old timeline states. Then > when you detect that > the doc has expired you switch to the "expired" > state that you've > designed which might addChild some text over the > document or whatever. > > > > -Alex > > > > ________________________________ > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of > Chris Boosalis > Sent: Monday, April 02, 2007 10:58 AM > To: [email protected] > Subject: Re: [flexcomponents] Simple Expiration > Component > > Hi, Ralf: > > I presume I could and will research it. But, I'm > stuck > as far as how to code it. AS2 and Flash was more > friendly, but pure Flex is a bit tough for me. Any > code hints would be helpful, as I am really trying > to > learn no on in my area to ask. > > Thx. > > --- Ralf Bokelberg <[EMAIL PROTECTED] > <mailto:ralf.bokelberg%40gmail.com> > wrote: > > > Hi Chris > > > > couldn't you use the Alert component for this? > > Other possibilities are a ViewStack with > > two views "expired" and "app", or states with > > two different states "expired" and app. > > > > Cheers > > Ralf. > > > > On 4/2/07, Chris Boosalis <[EMAIL PROTECTED] > <mailto:boosalic%40yahoo.com> > > > wrote: > > > > > > Basically, i want to make an expiration > > component that > > > I can reuse. I just would like to have something > > to > > > expire my drafts when I send them out. Nothing > at > > all > > > fancy or even secure. > > > > > > Now, I'm having smashing success making simple > > > components in Flex for login and email panels > (the > > > livedocs and other blogs have clear examples of > > > those). But because I'm used to AS 2.0 and a > > timeline, > > > I'm having trouble with what I know is a baby > > project > > > (beneath everyone here). > > > > > > In Flash, I used to use simple code from LA > Flash > > with > > > the timeline: > > > > > > theDate = new Date(); > > > if (theDate.getFullYear() >= 2007) { > > > if (theDate.getMonth() >= 1) { > > > if (theDate.getDate() > 4) { > > > gotoAndPlay("expired"); > > > } > > > } > > > } > > > > > > But I am lost in Flex and AS3. I'm not sure what > > > packages to import, whether the vars should be > > public > > > or private (or even how to state them, really), > or > > > what should be placed in between the mxml tags. > I > > > figure I will need a base state and an expired > > state > > > for my component, but getting there has been > > really > > > uphill. > > > > > > Any help would not only be helpful, but also > quite > > educational/merciful. > > > > > > > > > > > > > > -- > > Ralf Bokelberg <[EMAIL PROTECTED] > <mailto:ralf.bokelberg%40gmail.com> > > > Flex & Flash Consultant based in Cologne/Germany > > Phone +49 (0) 221 530 15 35 > > > > > >
