Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. class ::CLASS_NAME:: extends MovieClip { // exactly the same as before
  2. public function new () {
  3.  
  4. // This is the same as earlier
  5. if (!SWF.instances.exists ("::SWF_ID::")) {
  6.  
  7. SWF.instances.set ("::SWF_ID::", new SWF (Assets.getBytes ("::SWF_ID::")));
  8.  
  9. }
  10.  
  11. var swf = SWF.instances.get ("::SWF_ID::");
  12. var symbol = swf.data.getCharacter (::SYMBOL_ID::);
  13.  
  14. super (cast symbol);
  15. }
  16.  
  17. // Now here's where the frameScript map population would happen. All the code below is
  18. // generated by the openfl flash plugin
  19.  
  20. // frames 1, 17 and 29 are random values. Real values would be determined by the openfl
  21. // flash plugin based on which frames actually have code on them
  22.  
  23. frameScripts.set(1, function():void {
  24. // The code inside the anonymous function is literally a copied string of text that was
  25. // in the frame inside Flash Professional. I think that the string of the frame's content
  26. // can be gotten by the getScript() function in the SDK.
  27. stop();
  28. } );
  29.  
  30. frameScripts.set(17, function():void {
  31. // Maybe this frame has some different code
  32. goToAndStop(1);
  33. } );
  34.  
  35. frameScripts.set(29, function():void {
  36. // Maybe this frame has some haxe code that isn't valid actionscript code
  37. if(FileSystem.exists("myDir") == false) {
  38. FileSystem.createDirectory("myDir");
  39. }
  40. } );
  41.  
  42. }
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement