Simple .as file not working - what could be wrong?

I'm hopeing someone can point me in the right direction.

I am trying to re-create a demo by Lee Brimlow which he has on called 'Introduction to Pixel Bender 2'

I have managed to create a basic PixelBender filter - all good so far.

The problem is this:

I can't get his simple ActionScript file to work. In his demo everything works smoothly, however when I run mine the screen is blank - doh!

The file I have has the following code:

package {

import flash.display.*;
import flash.filters.*;

//Swf Metadata
[SWF(width="600", height="400", backgroundColor="#aa0000", framerate="30")]

public class Pixel extends Sprite

public image:Class;

private var loader:URLLoader;
private var shader:Shader;
private var filter:ShaderFilter;
private var im:Bitmap;

// Constants:
// Public Properties:
// Private Properties:

// Initialization:
public function Pixel():void
im = new image() as Bitmap;
addChild (im);

// Public Methods:
// Protected Methods:


This prog should display the file 'image.jpg on' the screen but instead the screen is blank.
'image.jpg' is in the same directory as the .as file without a doubt.

I'm compiling the above with Flash CS4

Does anyone know why this doesn't work?

Any help really appreciated.
Many thanks

Sci-Fi Si
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

are you actually able to compile without errors?

try fix this bit

public var image:Class;
NOT public image:Class;
Sci-Fi-SiAuthor Commented:
Excellent, that's a step closer, many thanks for the reply.

I have no idea how to compile this in Flash CS4, so I'm trying mxmlc.exe that comes with the Flex SDK.

The screen output from the command line compile are as follows:

C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.0.0\bin>mxmlc.exe >
C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.0.0\bin\ col: 22
 Error: Type was not found or was not a compile-time constant: Shader.

                private var shader:Shader;

C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.0.0\bin\ col: 22
 Error: Type was not found or was not a compile-time constant: ShaderFilter.

                private var filter:ShaderFilter;

If I try to compile from within Flash, I don't get any errors, but then I don't think it's including the .as file because the resulting .swf is only 1k and the image I'm trying to embed is over 60k.

Many thanks for your help! Do you know how I could get any further?

Sci-Fi Si
Sci-Fi-SiAuthor Commented:
Got Flash CS4 trying to compile but getting the following errors with the resulting .swf blank screen:

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Sci-Fi-SiAuthor Commented:
Thanks for your help blue-genie much appreciated, am I just being daft?

from the last attempted compile is looks as though Shader is not being understood but I don'tt know how to solve this.

Any thoughts?
i have no idea with CS4 but it seems like you're missing some packages.
go back to the site and check the downloads of if it mentions you need to download some external packages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sci-Fi-SiAuthor Commented:
Indeed I was,

Didn't know what all these packages were about but had a look round the net and found out how to add .as files to my library.

Got some stuff happening now. Many thanks for your input.

Sci-Fi-SiAuthor Commented:
Many thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.