In Beta2, it worked without being wrapped. One of the reasons for this
was that instead of using the updateDisplayList, I was drawing the box
in the contructor,it didn't have rely on the Flex framework to call
the updateDisplayList. The reason for doing this was that I wanted
the app to work as a stand alone AS in addition to being a Flex app.
Cheers,
Tim
--- In [email protected], "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> I would expect to have to compile an <mx:Application> containing the
> component in order to see anything. Are you saying that in Beta 2 you
> could just compile an AS component like MyTable.as into a SWF and run
> it?
>
>
>
> - Gordon
>
>
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of sufibaba
> Sent: Wednesday, May 10, 2006 7:40 PM
> To: [email protected]
> Subject: [flexcoders] Re: Beta3 Please Help
>
>
>
> Hello Gordon,
>
> Some Update:
>
> I found that when I compile only the MyTable.as file, nothing shows up.
> When I wrap it in an mxml file, then it works.
>
> ----- TestMain.mxml -------
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%"
> height="100%"xmlns="*">
> <MyTable />
> </mx:Application>
>
> ------------------
>
> Essentially, my real app has the following format.
>
> TestMain.mxml calls MyTable, and MyTable calls MyTable1 (which is the
> same structure as MyTable).
>
> MyTable1 is called in MyTable.as file: ---------
>
> override protected function updateDisplayList(unscaledWidth:Number,
> unscaledHeight:Number):void {
> super.updateDisplayList(unscaledWidth, unscaledHeight);
> // Check to see if style changed.
> if (bFillColorsChanged==true)
> {
> // Redraw gradient fill only if style changed.
> fillColorsData=getStyle("fillColors");
> graphics.beginGradientFill(GradientType.LINEAR, fillColorsData,
> alphas, ratios);
> graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
>
> var table1:MyTable1 = new MyTable1();
> addChild(table1);
> }
> --------------------
>
> It seems to me that the problem I am having in Beta3 is due to the fact
> that Beta3 doesn't show the MyTable.as file by itself, it only works
> when wrapped by an mxml file.
>
> I hope that this situation has an easy solution as the comp0nent I have
> been building took a while to make and a big change would be a bit of a
> disaster.
>
> Thanks again for helping out on this. Definitely Appreciated Big Time.
>
> Cheers,
>
> Tim
>
>
>
>
>
>
>
>
>
>
>
>
> --- In [email protected], "sufibaba" <sufibaba@> wrote:
> >
> > Hi Gordon,
> >
> > I am trying out a few things, below is an example from the Extending
> > Components.pdf docs, but it doesn't seem to be working. Can you see
> > if it works for you?
> >
> > ------------------------------------------
> >
> > package
> > {
> > import mx.core.UIComponent;
> > import mx.styles.CSSStyleDeclaration;
> > import mx.styles.StyleManager;
> > import flash.display.GradientType;
> > // Insert the [Style] metadata tag to define the name, type
> > // and other information about the style property for the
> > // MXML compiler.
> > [Style(name="fillColors",type="Array",format="Color",inherit="no")]
> >
> > public class MyTable extends UIComponent
> > {
> > // Define a static variable for initializing the style property.
> > private static var classConstructed:Boolean =! classConstruct();
> > // Define a static method to initialize the style.
> >
> > private static function classConstruct():Boolean {
> > if (!StyleManager.getStyleDeclaration("MyTable"))
> > {
> > // If there is no CSS definition for StyledRectangle,
> > // then create one and set the default value.
> > var newStyleDeclaration:CSSStyleDeclaration =
> > new CSSStyleDeclaration();
> > newStyleDeclaration.setStyle("fillColors", [0xFF0000, 0x0000FF]);
> > StyleManager.setStyleDeclaration("MyTable",
> > newStyleDeclaration, true);
> > }
> >
> > return true;
> > }
> > // Constructor
> > public function MyTable() {
> > super();
> > }
> > // Define a default size of 100 x 100 pixels.
> >
> > override protected function measure():void {
> > super.measure();
> > measuredWidth = measuredMinWidth = 100;
> > measuredHeight = measuredMinHeight = 100;
> > }
> &g! t;
> > // Define the variable to hold the current gradien! t fill c olors.
> > private var fillColorsData:Array;
> > // Define the flag that indicates a change to fillColors.
> > private var bFillColorsChanged:Boolean = true;
> > // Define variables for additional controls on the fill.
> > // You can create style properties for these as well.
> > private var alphas:Array = [1.0, 1.0];
> > private var ratios:Array = [0x00, 0xFF];
> > // Override styleChanged() to detect changes in your new style.
> > override public function styleChanged(styleProp:String):void {
> > super.styleChanged(styleProp);
> > // Check to see if style changed.
> > if (styleProp=="fillColors"){
> > bFillColorsChanged=true;
> > invalidateDisplayList();
> > return;
> > }
> > }
> >
> > // Override updateDisplayList() to update the component
> > // based on the style setting.
> >
> > override protected function updateDisplayList(unscaledWidth:Number,
> > unscaledHei! ght:Number):void {
> > super.updateDisplayList(unscaledWidth, unscaledHeight);
> > // Check to see if style changed.
> > if (bFillColorsChanged==true)
> > {
> > // Redraw gradient fill only if style changed.
> > fillColorsData=getStyle("fillColors");
> > graphics.beginGradientFill(GradientType.LINEAR, fillColorsData,
> > alphas, ratios);
> > graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
> > }
> > }
> > }
> > }
> >
> > -----------------
> >
> > Cheers,
> >
> > Tim
> >
> >
> >
>
>
>
> --
> 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
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+
> site+design+development&w2=Computer+software+development&w3=Software+des
> ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac
> tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
>
> Computer software development
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We
> b+site+design+development&w2=Computer+software+development&w3=Software+d
> esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
>
> Software design and development
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=
> Web+site+design+development&w2=Computer+software+development&w3=Software
> +design+and+development&w4=Macromedia+flex&w5=Software+development+best+
> practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
>
> Macromedia flex
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+
> development&w2=Computer+software+development&w3=Software+design+and+deve
> lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1
> 66&.sig=OO6nPIrz7_EpZI36cYzBjw>
>
> Software development best practice
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&
> w1=Web+site+design+development&w2=Computer+software+development&w3=Softw
> are+design+and+development&w4=Macromedia+flex&w5=Software+development+be
> st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
>
>
>
>
>
> ________________________________
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders> " on the web.
>
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>
>
>
> ________________________________
>
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

