Call the toString() method. This method returns the string representation of any type of object if available. : String : String Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » String » String »

 

Call the toString() method. This method returns the string representation of any type of object if available.


 

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


        var sTitle:String = new String("ActionScript Bible");
        
        trace(sTitle.toString())// Displays: ActionScript Bible
        
        //By default, the toString() method of an object is called if you attempt to use it where Flash is expecting a string. 
        
        var sTitle:String = new String("ActionScript Bible");
        
        trace(sTitle)// Displays: ActionScript Bible
        
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo String
» String