Stormwild

Tech & Life

  • Home
  • Graphic Design
  • About
  • Contact

Monthly Archives: December 2010

Actionscript (AS3) Attributes

Posted by admin on December 24, 2010

I recently discovered that what I thought were called attributes in actionscript (as3) were actually called metadata tags. An example of metadata tags in an actionscript class file would be:

package
{
import flash.display.Sprite;
import flash.events.Event;

/**
* ...
* @author Alexander R. Torrijos
*/
[SWF(backgroundColor="#ffcc00", frameRate="30", width="640", height="480")]
public class Main extends Sprite
{

public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}

private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
graphics.beginFill(0xff0000);
graphics.drawEllipse(100, 100, 100, 100);
graphics.endFill();
}

}

}

The highlighted code above is called a metadata tag in actionscript. In other programming languages they are usually referred to as attributes. When searching for information about attributes in actionscript remember to use the keyword metadata instead of attributes.

For some information on actionscript metadata you may want to check out AS3 Metadata Tags in Flex 4

Posted in Actionscript | Tagged attributes metadata tags | Leave a reply

This site runs on the required+ Foundation Theme. Based on the awesome Foundation Framework by the humble folks at ZURB.

Proudly powered by WordPress