prevent event continuing propagation:
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();
Flash Note
2013年8月26日 星期一
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
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
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
}
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.
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
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
Ctrl+K: align window
Ctrl + F8: create Symbol
Ctrl + F11: change symbol type
Movie Explorer : Alt + F3
Ctrl + Shift +Enter : debug run
訂閱:
意見 (Atom)