Using Expressions within Literals : XML Object : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » XML Object »

 

Using Expressions within Literals


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var squareLength:Number = 10;
        var circleRadius:Number = 5;
        var shapeData:XML = <shapeList>
                               <shape type="square" size={squareLength/>
                               <shape type="cicle" size={circleRadius/>
                            </shapeList>;
        trace(shapeData.toXMLString());

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» XML Object