2 Replies Latest reply on Jan 30, 2010 4:03 AM by Aphalin1

    How to set style?

    Aphalin1 Level 1

      <local:ImageRepeatCanvas id="ForBG"   width="1000" height="1000"   >












      import mx.containers.Canvas;

      1. function Init(){

      2. var O:Canvas=new Canvas();

      3. //O.width=60; If i remove "//" i will see colored square!!!
      4. //O.height=60;                "//" i will see colored square!!!
      5. O.setStyle("backgroundColor","#a48354");
      6. O.styleName="BG";
      7. ForBG.addChild(O);

      8. }


      As seen in the example i have BG style declared, but my canvas doesn't see it. So i do not see square since no width or height is declared (i do see it, if i declare them in code. Why?(tried O.setStyle("styleName","BG"); same result)