Monday, March 22, 2010

AS3, Flash movies and buttons

Okay, it's been a while since I used Flash (V.4) and things
have moved on just a smidge since. In previous versions Flash was
intuitive... coding was fairly minimal and doing the basics was
straight forward. I need to use Flash to do some fairly simple
stuff - a few buttons linked with various scenes and movies.



I followed the step-by-step instructions in the tutorial for
making a button to play a movie but:

1. The movie (an FLV) doesn't play (I get a flashing movie
icon when I test the page - the movie works fine when imported to
the scene on its own)

2. The button doesn't work



The code (according to the tutorial) should be:



movie1.stop();

but1.addEventListener(MouseEvent.MOUSE_DOWN,startclip);

function startclip(e:MouseEvent):void {

movie1.play();

AS3, Flash movies and buttons
Hmmm, even posting a message properly seems to be beyond at
the moment!



I meant to add the code that I get (following the steps in
the tutorial):



import flash.events.MouseEvent;

import flash.events.IEventDispatcher;

import flash.display.MovieClip;

movee1.stop();

but1.addEventListener(MouseEvent.MOUSE_DOWN,startclip);

function startclip(e:MouseEvent):void {

movee1.play();

No comments:

Post a Comment