Skip to content

Instantly share code, notes, and snippets.

@mogeta
Created November 14, 2012 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogeta/4070363 to your computer and use it in GitHub Desktop.
Save mogeta/4070363 to your computer and use it in GitHub Desktop.
LWF example
SetEventHandler("NoticePressEvent",(movie,button)=>{print("test");});
SetEventHandler("Done",(movie,button)=>{print("yatta!");});
fscommand ("event", "done");
using UnityEngine;
[ExecuteInEditMode]
public class LWFSampleObject : LWFObject {
public int count=0;
void Start()
{
string dir = System.IO.Path.GetDirectoryName(lwfName);
if (dir.Length > 0)
dir += "/";
if (Application.isEditor)
UseDrawMeshRenderer();
//sample swf
SetEventHandler("NoticePressEvent",(movie,button)=>{print("test");});
//get fscommand("event",done);
SetEventHandler("done",(movie,button)=>{print("test");});
//add eny event handler
SetMovieEventHandler("_root",
(movie)=>{print("load");},
(movie)=>{print("postload");},
(movie)=>{print("unload");},
(movie)=>{count++;print("onEnterFrame"+count);},
(movie)=>{print("update");},
(movie)=>{print("render");});
Load(lwfName, dir);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment