Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to setup a ClassPath?

Explorer ,
Nov 10, 2008 Nov 10, 2008
I am very new to Action script. I was following a Lynda tutorial on Action 3.0. Because the presenter uses a Mac and not PC, I didn't quite get what the path should be. What path should I be point this Classpath to? Is it to my .fla folder or to my .as folder? Anyway, what I end up in doing is pointing this path to my .as folder. However, when I did the Linkage to a button, the tutorial said to check on the Export for Action and Export in first frame check boxes; however, I'm not sure what to type for the Base class. I tried to type in my class name but it didn't work.

Will someone explain what the Classpath should be and how/what the Base class should be for Linkage?

Many thanks in advance.
TOPICS
ActionScript
5.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 10, 2008 Nov 10, 2008
ljCharlie,

>A definition for this class could not be found in the classpath,
> so one will be automatically generated in the SWF file upon
> export.

See those pencil icons in the Linkage properties dialog box? After you
enter the package for your DisablingButton class, click the pencil icon
associated with the Base class field. If Flash knows where your class file
is, it'll open that file for you right there in Flash.

Assuming that happens, we'll know Flash understands where your class
...
Translate
LEGEND ,
Nov 10, 2008 Nov 10, 2008
ljCharlie,

> What path should I be point this Classpath to?

Your best bet is to set aside a folder -- a dedicated folder, just for
class files -- and set your classpath to that folder. I'm on a WinXP
machine, so I keep a pair of folders inside My Documents called
"ActionScript 2.0 classes" and "ActionScript 3.0 classes," and I put my
custom class files into those, depending on the version of the language. My
classpath settings include the path to the "ActionScript 2.0 classes" folder
for AS2 work and the other one for AS3 work.

Inside your dedicated folder, you'll have additional subfolders as
dictated by the package hierarchy determined by each class file. Most
often, developers organize their class files into packages determined by
their domain names in reverse. My domain name, for example, is quip.net, so
I would put my own custom classes into net\quip\ subfolders inside my
dedicated folder. If I'm writing classes for manipulating bitmaps, I might
add a third subfolder:

net\quip\bitmaps\

... in which case my class would belong to the net.quip.bitmaps package,
such as this:

net.quip.bitmaps.CrazyBitmapClass.

Again, that "net" folder would be inside some dedicated folder on your
hard drive, and your classpath should only point to the dedicated folder
(such as C:\Documents and Settings\<user>\My Documents\ActionScript 3.0
classes\).

If you were using code from Adobe -- but not code that ships with Flash
directly -- you might create additional subfolders under your dedicated
folder -- com\adobe\ -- and put those new classes files in there.

> when I did the Linkage to a button, the tutorial said to check
> on the Export for Action and Export in first frame check boxes;
> however, I'm not sure what to type for the Base class. I tried
> to type in my class name but it didn't work.

The Base class field will be filled in for you automatically, based on
what sort of symbol you're linking. (A movie clip, for example, will
automatically have its base class set to flash.display.MovieClip.) The
thing you'll want to fill in is the Class field. If your aim is to be able
to attach this symbol at runtime, you don't actually have to *write* the
class that goes into the Class field, because Flash will write it for you
automatically. In fact, you'll see a warning message telling you so. If,
instead, you're actually writing a class file and wish to associate that
with your symbol, you'll enter the full package to that class file,
including the class's name. Alternatively, you could simply put the class's
name alone, if the class file is in the same folder as your FLA.


David Stiller
Co-author, Foundation Flash CS4 for Designers
http://tinyurl.com/5j55cv
"Luck is the residue of good design."


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2008 Nov 10, 2008
David,

Many thanks for the very details response.

Okay, so I set the Classpath to "F:\Tutorials\Exercise Files\start\classes" folder. My DisablingButton.as file is located in the "F:\Tutorials\Exercise Files\start\classes\myName\interactive" folder. In the DisablingButton.as file, I set the package to "package myName.interactive" and the Class name is DisablingButton.

So, when I use the Linkage to the button, I typed in the "myName.interactive.DisablingButton" for the base class field. I click the OK button, and I received a popup window with the following message:

A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.

Is this normal? If not, what should I put in the classpath to correct this error popup?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2008 Nov 10, 2008
ljCharlie,

> So, when I use the Linkage to the button, I typed in the
> "myName.interactive.DisablingButton" for the base class
> field.

So this is going to be your base class. That could be fine, but I'm
curious if that's really what your tutorial calls for? Should this be your
Class instead, or is is really supposed to be the Base class?

> I click the OK button, and I received a popup window
> with the following message:
>
> A definition for this class could not be found in the classpath,
> so one will be automatically generated in the SWF file upon
> export.

Do you have anything in the Class field for the linkage?


David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design."


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2008 Nov 10, 2008
Yes. In the Linkage Properties window, the tutorials said to type in "myName.interactive.DisablingButton" in the Base class text field. Yes, the button name (RecButton) is in the Class text field.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2008 Nov 10, 2008
ljCharlie,

> Yes. In the Linkage Properties window, the tutorials said
> to type in "myName.interactive.DisablingButton" in the
> Base class text field.

Okay.

> Yes, the button name (RecButton) is in the Class text field.

Roger that. So the RecButton "class" isn't really a class at all --
because you haven't written a RecButton class -- and in cases like that,
Flash will indeed give you a warning that no such class exists. In that
same warning, it tells you it will write this class for you (just an empty
class, really, and invisible to you). Does this warning message mention
RecButton by name? Or does it mention DisablineButton? If it mentions
RecButton, then you're seeing normal behavior, and you can (if you want)
click the checkbox that ignores the warning in the future.


David Stiller
Contributor, How to Cheat in Adobe Flash CS3
http://tinyurl.com/2cp6na
"Luck is the residue of good design."


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2008 Nov 10, 2008
A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.

That is the only message the popup window says. There is nothing else.

Here's the link to the specific tutorials.

http://www.yousendit.com/download/Y2o5MFhzTkxvQnZ2Wmc9PQ

This link will be active for 7 days.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2008 Nov 10, 2008
ljCharlie,

>A definition for this class could not be found in the classpath,
> so one will be automatically generated in the SWF file upon
> export.

See those pencil icons in the Linkage properties dialog box? After you
enter the package for your DisablingButton class, click the pencil icon
associated with the Base class field. If Flash knows where your class file
is, it'll open that file for you right there in Flash.

Assuming that happens, we'll know Flash understands where your class
file is, which means the warning message is the one for the Class input
field. If that's the case, then what you're seeing is expected behavior --
again, because there is not RectButton class file -- and you can use the "do
not show" checkbox to avoid this message in the future.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 11, 2008 Nov 11, 2008
quote:

See those pencil icons in the Linkage properties dialog box? After you
enter the package for your DisablingButton class, click the pencil icon
associated with the Base class field. If Flash knows where your class file
is, it'll open that file for you right there in Flash.


Yes. It does popup the DisablingButton class like you said.

quote:

Assuming that happens, we'll know Flash understands where your class
file is, which means the warning message is the one for the Class input
field. If that's the case, then what you're seeing is expected behavior --
again, because there is not RectButton class file -- and you can use the "do
not show" checkbox to avoid this message in the future.


If this is true then, why is the tutorial not showing this popup message?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 11, 2008 Nov 11, 2008
ljCharlie,

>> If that's the case, then what you're seeing is expected behavior --
>> again, because there is not RectButton class file -- and you can
>> use the "do not show" checkbox to avoid this message in the future.
>
> If this is true then, why is the tutorial not showing this popup message?

I'm guessing the presenter has already clicked that "do not show"
checkbox.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 11, 2008 Nov 11, 2008
LATEST
Ah, I see. Thanks for all your generous help. For now, I'll mark as this thread has been answered; however, I may come back later for more questions.

I'm very new to action script and Flash in general but I think it's time to get my feet wet in Flash.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines