Need beginner help

I used a tutorial from lynda.com learning ActionScript. I wrote a simple code to display a thumbnail, and on the passage of the mouse and expand. The Thumbnail.as code is as follows:

package com.lynda.as3et.photoviewer.ui
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.filters.DropShadowFilter;

Thumbnail/public class extends Sprite {}

private var _loader:Loader;
private var _width:Number;
private var _height:Number;
private var _mainAssetUrl:String;

public void miniature (url: String, mainUrl:String, defaultWidth:Number, defaultHeight:Number);
{
_width = defaultWidth;
_height = defaultHeight;
_mainAssetUrl = mainUrl;
_loader = new Loader();
var request: URLRequest = new URLRequest (url);
_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, goToDefaultState);
_loader. Load (request);
addChild (_loader);
_loader.addEventListener (MouseEvent.MOUSE_OVER, goToMouseOverState);
_loader.addEventListener (MouseEvent.MOUSE_OUT, goToDefaultState);
}

private void goToDefaultState(event:Event):void
{
_loader. ScaleX =. 9;
_loader. ScaleY =. 9;
_loader.filters = [new DropShadowFilter()];
}

private void goToMouseOverState(event:Event):void
{
_loader. ScaleX = 1;
_loader. ScaleY = 1;
_loader.filters = [DropShadowFilter (10,45,0x222222,1,10,10) News]
}

}
}

The code for PhotoViewer.as is as follows:

package {}

import flash.display.Sprite;
import com.lynda.as3et.photoviewer.ui.Thumbnail;

SerializableAttribute public class PhotoViewer extends Sprite
{
public void PhotoViewer()
{
miniatures: miniature var = new thumbnail ("Images/CronoCrossThumbnail.jpg", "Images/CronoCross.jpg", 90, 90);
addChild (thumbnail);
}
}
}

The error codes I get are as follows:

Gravity and Description path location creation time Id resource
1120: access of undefined property _loader. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 26 1234493943147 293

1180: call to a method may be undefined addChild. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 26 1234493943147 292

1120: access of undefined property _loader. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 25 1234493943147 290

1120: access of undefined property requests. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 25 1234493943147 291

1120: access of undefined property _loader. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 24 1234493943146 288

1120: access of undefined property goToDefaultState. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 24 1234493943146 289

1120: access of undefined property url. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 23 1234493943149 298

1120: access of undefined property url. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 23 1234493943149 299

1120: access of undefined property _loader. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 22 1234493943146 287

1120: access of undefined property _mainAssetUrl. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 285 1234493943144 21

1120: access of undefined property mainUrl. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 21 1234493943145 286

1120: access of undefined property _height. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 20 1234493943144 283

1120: access of undefined property defaultHeight. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 20 1234493943144 284

1120: access of undefined property _width. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 19 1234493943143 281

1120: access of undefined property defaultWidth. PhotoViewer/com/lynda/as3et/photoviewer/ui Thumbnail.as line 19 1234493943144 282

I have absolutely no idea what I'm doing wrong. Can anyone help?

Thank you.

Notice that there is a semicolon at the end of the constructor of the tile. This one

public void miniature (url: String, mainUrl:String, defaultWidth:Number, defaultHeight:Number); //< ----="">

Delete it and everything works perfectly (regarding the Thumbnail.as :)

HTH

Tags: Flex

Similar Questions

Maybe you are looking for