Flash Tests

posted under by Philip Howlett
Here's some of the work we've been doing with AS3.0. I'm starting to get the basic rules, but I'm a long way off being able to sit and down and start typing code. The first example is a multiple choice quiz which you can try out here. The questions are ridiculous, but they aren't what was important in the task. Here's a snippet of the code I've been using:
var score=0;
q1a.buttonMode = true;
q1a.addEventListener(MouseEvent.CLICK,
function(myEventObject){gotoAndStop(2);});



The piece of code in bold is something I found myself. I didn't like the way objects were clickable, but they didn't act as a button would. Adding that line of code brings up a hand when your mouse navigates over the objects.

The second piece I did was a simple interface which moves a box around the screen. To have a go with it look here. It was a useful exercise in understanding how to create some simple controls. I'm not sure how I'm going to be making use of it just yet, but I hope to have my flash work completed by the end of next week. Again, a little glimpse of the code:
//UP BUTTON//
my_button.buttonMode = true;
my_button.addEventListener(MouseEvent.CLICK, function(myEventObject){box1.y = box1.y - 5;});

0 comments

Make A Comment
top