eirexe

Untitled

Jun 24th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import adobe.utils.MMExecute;
  2. import fl.data.DataProvider;
  3. var charToAdd
  4. var listFull:String
  5. var ToPlace:String
  6. var CharToCreate:String
  7. Delete.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_4);
  8.  
  9.  
  10.  
  11. function AddThingg(a:String, b:String):void {
  12.     //arg.split("#")
  13.     if(b == "") {
  14.         Tiles.dataProvider.removeAll();
  15.     } else {
  16.         trace("aa")
  17.         listFull = a
  18.         var asd:Array = a.split("#")
  19.         var bsd:Array = b.split("#")
  20.         Tiles.dataProvider.removeAll();
  21.         for(var i:uint=0; i < asd.length; i++) {
  22.             Tiles.addItem({label:bsd[i], source:asd[i]})
  23.        
  24.         }
  25.     }
  26.  
  27. }
  28. var ToDel:String
  29. ButtonAdd.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
  30.  
  31. function fl_MouseClickHandler(event:MouseEvent):void
  32. {
  33.     if(textt.text != ""){
  34.         charToAdd = textt.text;
  35.         MMExecute("fl.runScript( fl.configURI + \"CharacterMan/AddToList.jsfl\" );");
  36.         //TODO: execute updating script
  37.     }
  38. }
  39.  
  40. function ListUpd():String {
  41.     var charT:String;
  42.     charT = charToAdd
  43.     return charT;
  44. }
  45.  
  46. /* Mouse Click Event
  47. Clicking on the specified symbol instance executes a function in which you can add your own custom code.
  48.  
  49. Instructions:
  50. 1. Add your custom code on a new line after the line that says "// Start your custom code" below.
  51. The code will execute when the symbol instance is clicked.
  52. */
  53.  
  54. movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
  55.  
  56. function fl_MouseClickHandler_2(event:MouseEvent):void
  57. {
  58.     // Start your custom code
  59.     // This example code displays the words "Mouse clicked" in the Output panel.
  60.     MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CharManInit.jsfl\" );");
  61.     // End your custom code
  62. }
  63. function GetListRaw():String {
  64.     var dp:DataProvider = Tiles.dataProvider
  65.     var ListRaw:String
  66.     for(var i=0;i<dp.length;i++) {
  67.         var labeel:String = dp.getItemAt(i).label
  68.         if(i==0){
  69.             ListRaw =  labeel + "#"
  70.         } else {
  71.             ListRaw = ListRaw + labeel + "#"
  72.         }
  73.         if(i==(dp.length-1)){
  74.             ListRaw = ListRaw + labeel
  75.         }
  76.     }
  77.     return ListRaw;
  78.    
  79. }
  80.  
  81.  
  82. movieClip_2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);
  83.  
  84. function fl_MouseClickHandler_3(event:MouseEvent):void
  85. {
  86.     if (Tiles.selectedItem.label != "") {
  87.         CharToCreate = Tiles.selectedItem.label
  88.         MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CreateChar.jsfl\" );");
  89.     }
  90. }
  91. function fl_MouseClickHandler_4(event:MouseEvent):void
  92. {
  93.     // Start your custom code
  94.     // This example code displays the words "Mouse clicked" in the Output panel.
  95.     var st:Object = Tiles.selectedItem
  96.    
  97.     ToDel=Tiles.selectedItem.label
  98.     MMExecute("fl.runScript( fl.configURI + \"CharacterMan/DelFromList.jsfl\" );");
  99.     // End your custom code
  100. }
  101. function ListDel():String {
  102.     return ToDel;
  103. }
  104.  
  105. function CharCret():String {
  106.     return CharToCreate;
  107. }
  108.  
  109. ExternalInterface.addCallback("AddThing", AddThingg);
  110. ExternalInterface.addCallback("ListUpdate", ListUpd);
  111. ExternalInterface.addCallback("DeleteChar", ListDel);
  112. ExternalInterface.addCallback("CreateChar", CharCret);
  113. MMExecute("fl.runScript( fl.configURI + \"CharacterMan/CharManInit.jsfl\" );");
  114.  
  115. function jsTrace(str:String):void{
  116.     MMExecute("fl.trace(\"" + str + "\");");
  117. }
Advertisement
Add Comment
Please, Sign In to add comment