Hi Creative Bees :)


In this article, we will show you how to correctly edit your .SWF file to use with the "Event" trigger.


Here is a short video we created so it will be easier:


[Can't see the video? Click here to watch on YouTube]


 

You can create any kind of animation or import one, the "touch" trigger won't work for elements that are imported as "Movie Clips".


So what you need to do is to:
  • Create a new layer on top of the timeline.
  • Create a new shape in the area that you want to activate the touch, press F8 to convert it to a movie clip, and give the shape object a name.


***Make sure to change the symbol name in the properties window***


  • Add a new layer above it and press F9 for script action and use this:

import flash.events.Event;

import flash.events.MouseEvent;

 

my_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick);

 

function onMouseClick(event : MouseEvent) : void

{

dispatchEvent(new Event("nextStateEvent",true));

}


 
Change "my_btn" to your shape object name.

 

And that's it.