Forum Topic: AS3 Packages & Classes

(99 views • 9 replies)

This topic is 1 page long.

<< < > >>
None

yoyobebob

Reply To Post Reply & Quote

Posted at: 11/6/09 05:16 PM

yoyobebob NEUTRAL LEVEL 03

Sign-Up: 03/16/06

Posts: 148

I'm ready to start using my own custom classes, but how do I import them into flash? I know I do the publish settings thing, but i keep getting

5001: The name of package 'TracerClass' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\*********\Desktop\TracerClass\TracerClass.as

I know there is a certain folder layout thing I need to have. So if I want the folder on my desktop, how do I get my classes to work in flash?

I love xbox live and I like flash games too!

BBS Signature

None

Johnny

Reply To Post Reply & Quote

Posted at: 11/6/09 05:18 PM

Johnny DARK LEVEL 21

Sign-Up: 04/17/04

Posts: 4,429

At 11/6/09 05:16 PM, yoyobebob wrote: I know there is a certain folder layout thing I need to have. So if I want the folder on my desktop, how do I get my classes to work in flash?

The easiest way is to just keep all of your classes in the same folder as your .fla. If you do that, its imported automatically.

All sites currently down. Deal with it. <3

BBS Signature

None

yoyobebob

Reply To Post Reply & Quote

Posted at: 11/6/09 05:53 PM

yoyobebob NEUTRAL LEVEL 03

Sign-Up: 03/16/06

Posts: 148

oh sex thank ye

I love xbox live and I like flash games too!

BBS Signature

None

yoyobebob

Reply To Post Reply & Quote

Posted at: 11/6/09 05:56 PM

yoyobebob NEUTRAL LEVEL 03

Sign-Up: 03/16/06

Posts: 148

I tried that but it keeps saying:

5001: The name of package 'TracerClass' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\**********\Desktop\ClassArea\Tr acerClass.as

I love xbox live and I like flash games too!

BBS Signature

None

Johnny

Reply To Post Reply & Quote

Posted at: 11/6/09 05:57 PM

Johnny DARK LEVEL 21

Sign-Up: 04/17/04

Posts: 4,429

What is the exact name you've given your package? (That sounds dirty)
Is it in the exact same folder as the .fla you're working on?

All sites currently down. Deal with it. <3

BBS Signature

None

TheBoob

Reply To Post Reply & Quote

Posted at: 11/6/09 06:01 PM

TheBoob NEUTRAL LEVEL 12

Sign-Up: 04/12/02

Posts: 387

What does your first package line say, im not 100% sure, but i think it is going to say something like

package ClassArea

when it should just say (if you are keeping it in the same folder as the fla file)

package


None

yoyobebob

Reply To Post Reply & Quote

Posted at: 11/6/09 06:54 PM

yoyobebob NEUTRAL LEVEL 03

Sign-Up: 03/16/06

Posts: 148

Now it says just "package"
Here is my .as file:

package{

public class TraceIt{
public function TraceIt(){
trace("Hello World!");
}
}
}

Is that right?
I saved both the .fla and this .as in the same folder on my desktop

I love xbox live and I like flash games too!

BBS Signature

None

K-Guare

Reply To Post Reply & Quote

Posted at: 11/6/09 07:06 PM

K-Guare FAB LEVEL 17

Sign-Up: 05/23/08

Posts: 2,413

I just made a new document, AS3.
This code is on the timeline:

var traceThis:TraceIt = new TraceIt();

And this code is in a file called TraceIt.as
in the exact same directory as the FLA:

package{
	public class TraceIt{
		public function TraceIt(){
			trace("Hello World!");
		}
	}
}

And that traces "Hello World!"
Start over and try that I guess. Heh.

At 11/6/09 05:57 PM, Johnny wrote: What is the exact name you've given your package? (That sounds dirty)

LOL

i work alone. i wore cologne.

BBS Signature

None

yoyobebob

Reply To Post Reply & Quote

Posted at: 11/6/09 07:18 PM

yoyobebob NEUTRAL LEVEL 03

Sign-Up: 03/16/06

Posts: 148

IM AN IDIOT I FORGOT TO PUT var INFRONT OF MY THING
wow thanks guys

I love xbox live and I like flash games too!

BBS Signature

None

zrb

Reply To Post Reply & Quote

Posted at: 11/6/09 07:42 PM

zrb LIGHT LEVEL 11

Sign-Up: 08/08/06

Posts: 4,548

At 11/6/09 07:18 PM, yoyobebob wrote: IM AN IDIOT I FORGOT TO PUT var INFRONT OF MY THING

It happens to the best of us...or not ?
Congrats for fixing it lmao :)

School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 12:03 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!