Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 06-22-2007, 02:15 PM   #1
Member (7 bit)
 
Join Date: Dec 2005
Posts: 87
Actionscript question

Can I do something like this?

class menuItem{
private string menuName;
...
...
...
}

You know, like use private and public for class properties?

If not, what the hell was Macromedia thinking?

Last edited by hartken; 06-22-2007 at 04:33 PM.
hartken is offline   Reply With Quote
Old 06-22-2007, 07:17 PM   #2
Member (7 bit)
 
Join Date: Dec 2005
Posts: 87
Also will actionscript allow me to call another class I created in the class file?

Like if I have a class called "menu" defined in menu.as, and then want to call another class I created called "menuItem" made in another file called menuItem.as?

Why even make a framework if you can't do something like that?
hartken is offline   Reply With Quote
Old 06-22-2007, 08:20 PM   #3
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
yes, you can use public/private for variables in classes.

Yes, you can call other classes from within classes so long as the import statement is in the main fla file.

Code:
class menu {
public mItem = new menuItem();
}
Check out this article and the other parts of the series...it's very good at explaining how to work with classes in AS:
http://www.gotoandplay.it/_articles/.../as2_part2.php
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
Force Flow is offline   Reply With Quote
Old 06-23-2007, 08:12 AM   #4
Member (7 bit)
 
Join Date: Dec 2005
Posts: 87
Thanks!
hartken is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
motherboard question Zeppelin1432 Computer Hardware 3 06-25-2005 12:37 PM
Stereo as computer sound question longrawker Home Theater, Audio, and Video 5 05-30-2005 02:28 PM
cd burning software question / "sticky" question chunkstyle Home Theater, Audio, and Video 2 03-29-2005 11:55 AM
Small question Gizmo Software Discussion & Support 3 09-03-2004 06:36 PM
Important network question Ymets2k Networking & Online Security 0 01-25-2003 02:49 PM


All times are GMT -5. The time now is 07:30 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2