PDA

View Full Version : book coding doesn't work



SteelCity
December 14th, 2007, 12:52 PM
The coding comes straight from the book (minus my targeted url,and button instance name) How come I keep getting error messages whenever I use coding from the manuals. see example below.... Thanks guys

var myUrl:URLRequest = new URLRequest ("../images/questionpage.swf");
function clickButton(myevent:MouseEvent):void{
navigateToUrl(myUrl);
}
lio_btn.addEventListener(MouseEvent.CLICK, clickButton)

errors:
MouseEvent from the function line can't be loaded
URLRequest from var line can't be loaded

note:
whenever I have a
(myevent:______) whatever is in the blank doesn't load

Felixz
December 14th, 2007, 01:23 PM
first import those classes

notSoMuch
December 14th, 2007, 02:42 PM
first import those classes

Excellent point, Felix...too bad the author does not tell you that...which, I guess, is why we are here instead of the bookstore.

A friend of mine bought me the "Adobe Flash CS3 Bible," which clearly states on the cover "Write ActionScript 3.0 code for Flash." However, everytime it mentions code, it is in AS2. It even tells you to go to chapter 28, or go to page 731 to see how this is done in AS3.

Sadly, as you flip to said pages, you are told that AS3 will not be covered and are reminded to save your documents as AS2.

It's a !@#$% crock of !@#$%!! :beer:

SteelCity
December 14th, 2007, 03:54 PM
Guys thank you sooooo much!!

So I need to include the following lines to import those claseses

import flash.display.*;

import flash.event.*;

Rezmason
December 14th, 2007, 04:13 PM
Sadly, as you flip to said pages, you are told that AS3 will not be covered and are reminded to save your documents as AS2.

It's a !@#$% crock of !@#$%!! :beer:

What a crying shame! :upset: How could you publish and market the book, with that sort of slip-up? Especially if you call it a Bible. I mean, I'm no rabbi, but if someone tells me to read their book, "Oh it's so great, in fact we're gonna call it the Flash Bible"... and it turns out to be a $#!%-crock... I mean it's just so obnoxious.

EDIT:...I mean, that would go on the editor's checklist, up at the top, wouldn't it? "Item: NO SLIP-UPS. After all, we're calling it a Bible."