Set in a material way interactive and engaging event with a plan:
1 2 3 4 5 6 7 8
| BitmapAssetMaterial = new BitmapAssetMaterial ( "foto1" ) ; var mymaterial: BitmapAssetMaterial BitmapAssetMaterial = new ("photo1"); ; mymaterial. interactive = true; Plane = new Plane ( my_material , 200 , 100 , 0 , 0 ) ; var myplane: Plane = new Plane (my_material, 200, 100, 0, 0); ( InteractiveScene3DEvent . OBJECT_PRESS , myplane. addEventListener (InteractiveScene3DEvent. OBJECT_PRESS, e : InteractiveScene3DEvent ) : void { function (e: InteractiveScene3DEvent): void { / / Todo } ); |
Continued ...
In Actionscript 3.0 you must use addEventListener() to intercept any event:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| / ** * Given a MovieClip mc, you set events and handlers * / ( MouseEvent . CLICK , on_click ) ; mc. addEventListener ( MouseEvent . CLICK, on_click); ( MouseEvent . ROLL_OVER , on_roll_over ) ; mc. addEventListener ( MouseEvent . ROLL_OVER, on_roll_over); ( MouseEvent . ROLL_OUT , on_roll_out ) ; mc. addEventListener ( MouseEvent . ROLL_OUT, on_roll_out); / ** * Functions hander for the above events * / e : MouseEvent ) : void { on_click function (e: MouseEvent ): void { / / Click } e : MouseEvent ) : void { on_roll_over function (e: MouseEvent ): void { / / Roll over } e : MouseEvent ) : void { on_roll_out function (e: MouseEvent ): void { / / Roll-out } |
Continued ...
I draw inspiration by the excellent tutorial Napolux , Flex 3, Adobe AIR and the API Feedburner , which shows how to write a simple application (or widgets) using Flex 3 Adobe AIR, to show how to accomplish the same thing using Adobe Flash CS3. If you wish, and you can also use the extension for creating Adobe AIR applications. It is not necessary for the purposes of this tutorial, complete the application as an AIR executable, you can use the proposed code as a simple Flash movie to be "affixed" to your Web pages
Continued ...
Finally with ActionScript 3.0 no longer have two different management of events as they did before ActionScript 2.0 (see: Event management: similarities between Flash and Javascript ). The method addEventListener() , ubiquitous in the new architecture allows to manage new and exceptionally clean all possible events, even personal ones. The new organization in the package allows you to import the events that we serve and treat everyone equally:
Continued ...
Latest Comments
Mark : @ Mark: Thanks for the answer. For example, if you have a code to save / use the folder ...
Mark : Thanks for the answer. For example, if you have a code to save / use the folder ...
Giovambattista Fazioli : @ Mark: in principle, absolutely, a lot depends on how and what to download. La. ..
Mark : Hello, good guide! I wanted to ask, you can use the same code to run a sql database? Instead of ...
Joseph : Hi I wanted to ask you how you can do in the post I uploaded a gallery of 50 images, for example, ...