2013年8月26日 星期一

[Flex][Flash] Event related

prevent event continuing propagation:
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();

2013年6月10日 星期一

[Flex, Flash] use XML

 var myXML:XML = new XML("<root><person name='Mike'/><person name='Bike'/></root>");
trace(myXML.person[0].@name);
var yourXML:XML = <root><person name='Mike'/><person name='Bike'/></root>;
trace(myXML.person[1].@name);

value in XML is String by default

[Flex & Flash] openAync

http://www.flashas.net/html/air/20091005/4593.html

2013年6月9日 星期日

[Flex] Coding Note

Using Sprite in flex:
class needs to be inherited from "SpriteVisualElement", not "Sprite"

for each and for key:
for each : get value
var obj:Object = {x:10, y:20};
for each (var num in obj)
{
   trace(num); //get 10, 20
}

for (var key:String in obj)
{
     trace(obj[key]);//get 10, 20. but key is x, y
}

[Flex] use SWF in web page

ExternalInterface

The ExternalInterface class is an application programming interface that enables straightforward communication between ActionScript and the SWF container– for example, an HTML page with JavaScript or a desktop application that uses Flash Player to display a SWF file.
Using the ExternalInterface class, you can call an ActionScript function in the Flash runtime, using JavaScript in the HTML page. The ActionScript function can return a value, and JavaScript receives it immediately as the return value of the call.
This functionality replaces the fscommand() method.

[Flex, Flash] Events

currentTarget: object that is processing this event (object that register this listener)
target: object that actually fires the event

[Flash] Keys

http://www.webwasp.co.uk/tutorials/038/index.php

Ctrl+K: align window

Ctrl + F8: create Symbol

Ctrl + F11:  change symbol type

Movie Explorer : Alt + F3

Ctrl + Shift +Enter : debug run