Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import adobe.utils.MMExecute;
- import fl.data.DataProvider;
- var charToAdd
- var listFull:String
- var ToPlace:String
- var CharToCreate:String
- Delete.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_4);
- function AddThingg(a:String, b:String):void {
- //arg.split("#")
- if(b == "") {
- Tiles.dataProvider.removeAll();
- } else {
- trace("aa")
- listFull = a
- var asd:Array = a.split("#")
- var bsd:Array = b.split("#")
- Tiles.dataProvider.removeAll();
- for(var i:uint=0; i < asd.length; i++) {
- Tiles.addItem({label:bsd[i], source:asd[i]})
- }
- }
- }
- var ToDel:String
- ButtonAdd.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
- function fl_MouseClickHandler(event:MouseEvent):void
- {
- if(textt.text != ""){
- charToAdd = textt.text;
- MMExecute("fl.runScript( fl.configURI + \"CharacterMan/AddToList.jsfl\" );");
- //TODO: execute updating script
- }
- }
- function ListUpd():String {
- var charT:String;
- charT = charToAdd
- return charT;
- }
- /* Mouse Click Event
- Clicking on the specified symbol instance executes a function in which you can add your own custom code.
- Instructions:
- 1. Add your custom code on a new line after the line that says "// Start your custom code" below.
- The code will execute when the symbol instance is clicked.
- */
- movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
- function fl_MouseClickHandler_2(event:MouseEvent):void
- {
- // Start your custom code
- // This example code displays the words "Mouse clicked" in the Output panel.
- MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CharManInit.jsfl\" );");
- // End your custom code
- }
- function GetListRaw():String {
- var dp:DataProvider = Tiles.dataProvider
- var ListRaw:String
- for(var i=0;i<dp.length;i++) {
- var labeel:String = dp.getItemAt(i).label
- if(i==0){
- ListRaw = labeel + "#"
- } else {
- ListRaw = ListRaw + labeel + "#"
- }
- if(i==(dp.length-1)){
- ListRaw = ListRaw + labeel
- }
- }
- return ListRaw;
- }
- movieClip_2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);
- function fl_MouseClickHandler_3(event:MouseEvent):void
- {
- if (Tiles.selectedItem.label != "") {
- CharToCreate = Tiles.selectedItem.label
- MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CreateChar.jsfl\" );");
- }
- }
- function fl_MouseClickHandler_4(event:MouseEvent):void
- {
- // Start your custom code
- // This example code displays the words "Mouse clicked" in the Output panel.
- var st:Object = Tiles.selectedItem
- ToDel=Tiles.selectedItem.label
- MMExecute("fl.runScript( fl.configURI + \"CharacterMan/DelFromList.jsfl\" );");
- // End your custom code
- }
- function ListDel():String {
- return ToDel;
- }
- function CharCret():String {
- return CharToCreate;
- }
- ExternalInterface.addCallback("AddThing", AddThingg);
- ExternalInterface.addCallback("ListUpdate", ListUpd);
- ExternalInterface.addCallback("DeleteChar", ListDel);
- ExternalInterface.addCallback("CreateChar", CharCret);
- MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CharManInit.jsfl\" );");
- function jsTrace(str:String):void{
- MMExecute("fl.trace(\"" + str + "\");");
- }
Advertisement
Add Comment
Please, Sign In to add comment