Evan:
 
Good question! I think that the primary difference between a component and a class is how you use it. You import a class using the ActionScript import statement and then access the properties and methods of that class in your ActionScript code, whereas a component is declared using an MXML tag.
 
Here's some stuff on building custom components:
 
You may have already noticed that the documentation on writing an ActionScript class actually links back to the section on building components, which helps to make your point, that there isn't much difference between a component and a class:
 
There are some classes (such as SimpleButton) that are accessible via ActionScript but not MXML tags. Apart from that, I don't think there is any difference between components and classes. If my understanding is lacking, I trust that others on the list will make necessary corrections.
 
Jim
 
 
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Evan Gifford
Sent: Tuesday, June 20, 2006 2:03 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] High Level: Actionscript Components vs. Importing Actionscript Classes

Wow .. .I’m humbled to ask this question .. but the truth is I can’t find an answer to this:

In the LiveDocs article here:

http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000453.html

It states the 5 ways that actionscript can be worked into MXML.

The first 3 I understand, basics like using actionscript in an event handler and embedding it into the MXML file.

The last two though are confusing to me:

·                       Import ActionScript classes.

·                       Create ActionScript components.

What is the difference between importing classes and Creating/Using actionscript components?

Thanks Guys, I’m honored to be a part of this list and hope to be able to contribute to it soon.

-Evan


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tim Hoff
Sent: Monday, June 19, 2006 7:38 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Accordion state change?

Instead of states, you can use a little binding, like:

<mx:Text x="10" y="10" text="{ScriptsAccordion.selectedChild.label}
Page Text" width="218" id="text1"/>

Or, create an Array that contains the text that you want to display,
in the same order as the Accordion children. You would then
similarly bind like:

text="{myArray[ScriptsAccordion.selectedIndex]}"

-TH

--- In [EMAIL PROTECTED]ups.com, Impudent1 <[EMAIL PROTECTED]..> wrote:
>
> I have been playing with flex a bit lately, doing the tutorials,
some
> web examples from the blogs (ty all ;p )
>
> I decided to try to rebuild a basic web page that currently lists
all
> the scripts I created for After Effects in Flex2B3.
>
> What I am stuck on is trying to have an accordion navigator change
the
> content in a specific canvas. I currently have setup states to do
this.
> Thinking that I would be able to setup a function that would test
the
> accordions selected id vs a list of states and change accordingly
I
> setup the following:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
> <mx:states>
> <mx:State name="BackBurnerSubmitUI">
> <mx:SetProperty target="{text1}" name="text"
> value="Backburner page text"/>
> </mx:State>
> <mx:State name="BackupProject">
> <mx:SetProperty target="{text1}" name="text"
> value="BackupProject page text"/>
> </mx:State>
> <mx:State name="Calc">
> <mx:SetProperty target="{text1}" name="text"
value="Calc
> page text"/>
> </mx:State>
> <mx:State name="DefaultFolders">
> <mx:SetProperty target="{text1}" name="text"
value="Default
> Folders page text"/>
> </mx:State>
> <mx:State name="DropFootageTime0">
> <mx:SetProperty target="{text1}" name="text"
> value="DropFootage page text"/>
> </mx:State>
> <mx:State name="FilmCalc">
> <mx:SetProperty target="{text1}" name="text"
> value="Filmcalc page text"/>
> </mx:State>
> <mx:State name="FontCollector">
> <mx:SetProperty target="{text1}" name="text"
value="Font
> collector page text"/>
> </mx:State>
> <mx:State name="GoWarpStatic">
> <mx:SetProperty target="{text1}" name="text"
value="Gowarp
> page text"/>
> </mx:State>
> <mx:State name="Gspot">
> <mx:SetProperty target="{text1}" name="text"
value="Gspot
> page text"/>
> </mx:State>
> <mx:State name="ImportExportLayouts">
> <mx:SetProperty target="{text1}" name="text"
value="Layouts
> page text"/>
> </mx:State>
> <mx:State name="ImportExportMRU">
> <mx:SetProperty target="{text1}" name="text"
value="MRU
> page text"/>
> </mx:State>
> <mx:State name="MusterBatchUI">
> <mx:SetProperty target="{text1}" name="text"
> value="Musterbatch page text"/>
> </mx:State>
> <mx:State name="MusterSubmitUI">
> <mx:SetProperty target="{text1}" name="text"
> value="Mustersubmit page text"/>
> </mx:State>
> <mx:State name="RenderAndShutdown">
> <mx:SetProperty target="{text1}" name="text"
> value="Rendershutdown page text"/>
> </mx:State>
> <mx:State name="SamplerSizerRadio">
> <mx:SetProperty target="{text1}" name="text"
> value="Samplersizer page text"/>
> </mx:State>
> </mx:states>
>
> <mx:Script>
> <![CDATA[
> // Import the class that defines the event object.
> import mx.events.IndexChangedEvent;
> // set the function
> private function
> ScriptsAccChange(event:IndexChangedEvent):void {
> // set the state to fit the accordion index
> if(event.newIndex ==
> 1){currentState="'BackBurnerSubmitUI'"}
>
> }
> ]]>
> </mx:Script>
>
> <mx:Accordion x="10" y="55" width="240"
resizeToContent="true"
> id="ScriptsAccordion" change="ScriptsAccChange(event)">
> <mx:Canvas label="Main Page" width="100%" height="0"
id="MainPage">
> </mx:Canvas>
> <mx:Canvas label="Backburner Submit UI" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10" text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="20" y="35" text="1.0"/>
> <mx:Label x="64" y="36" text="18, 7, 2004"/>
> <mx:Label x="156" y="36" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Backup Project" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="17, 7, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:Label x="23" y="50" text="1.2"/>
> <mx:Label x="64" y="50" text="28, 1, 2006"/>
> <mx:Label x="166" y="50" text="AE 7"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Calc" width="100%" height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="18, 7, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:Label x="23" y="50" text="2.0"/>
> <mx:Label x="70" y="50" text="6, 9, 2006"/>
> <mx:Label x="150" y="50" text="Mac UI Fix"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Default Folders" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.8"/>
> <mx:Label x="64" y="35" text="18, 7, 2004"/>
> <mx:Label x="145" y="35" text="AE 7,Mac Fix"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Drop Footage Time 0" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="20, 6, 2004"/>
> <mx:Label x="148" y="35" text="AE 6.5 only"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="FilmCalc" width="100%" height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="17, 8, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Font Collector" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="10, 6, 2005"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Go Warp Static" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="21, 6, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Gspot" width="100%" height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="21, 6, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:Label x="23" y="50" text="2.0"/>
> <mx:Label x="64" y="50" text="23, 1, 2006"/>
> <mx:Label x="145" y="50" text="AE 7,Mac Fix"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Import/Export Layouts" width="100%"
> height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="xx, x, 2006"/>
> <mx:Label x="162" y="35" text="AE 7"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Import/Export MRU" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="xx, x, 2006"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Muster Batch UI" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="xx, x, 2006"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Muster Submit UI" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="xx, x, 2006"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Render and Shutdown" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="25, 11, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:Label x="23" y="50" text="2.0"/>
> <mx:Label x="64" y="50" text="20, 1, 2005"/>
> <mx:Label x="145" y="50" text="AE 7,Mac Fix"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
> <mx:Canvas label="Sampler Sizer Radio" width="100%"
height="100%">
> <mx:Label x="10" y="10" text="Version"/>
> <mx:Label x="85" y="10 " text="Date"/>
> <mx:Label x="148" y="10" text="Description"/>
> <mx:Label x="23" y="35" text="1.0"/>
> <mx:Label x="64" y="35" text="21, 6, 2004"/>
> <mx:Label x="156" y="35" text="AE 6.5 +"/>
> <mx:HRule x="10" y="10" width="220" height="36"/>
> </mx:Canvas>
>
> </mx:Accordion>
>
> <mx:Canvas x="258" y="10" width="756" height="40"
label="Header"
> id="HeaderCanvas">
> <mx:Text x="32" y="0" text="These are some scripts I
created to
> learn Adobe's Extendscript. They have all been tested but use at
your
> own risk." width="654" height="20"/>
>
> <mx:Text width="700" y="10" x="10">
> <mx:htmlText><![CDATA[
> Usage is free, but if you wish to give something back, please <a
> href=""http://www.leapfrog-">http://www.leapfrog-
productions.com/Scripts/A_R_links.html"><font
> color="#008800">donate to a reputable animal advocacy
group</a></font>
> in your area.
> ]]></mx:htmlText>
> </mx:Text>
>
> </mx:Canvas>
> <mx:Canvas x="258" y="58" width="756" height="607"
id="MainStage"
> label="MainStage">
> <mx:Text x="10" y="10" text="main page text" width="218"
> id="text1"/>
> </mx:Canvas>
>
> </mx:Application>
>
>
> If you click on the BackBurner Submit UI accordion header, you get
the
> actionscript error dialog stating that it has an ArguementError:
> Undefined state "BackBurnerSubmitUI"
>
> So I guess the big question I have is: how do you make sure states
are
> included in the scope of the function?
>
> Second question: If you click on the Main accordion header you
will see
> it opens a whitespace even tho the height field is set to 0. I
assume
> this is because of the resizeToContent="true" flag, but I cannot
find
> any way to adjust the whitespace numbers.
>
> tia and I am glad to find this list resource, In the future I hope
to be
> able to leverage Flex with the other adobe suite apps using
bridgetalk
> or ajax.
>
> Impudent1
> LeapFrog Productions
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to