|
#1
|
||||
|
||||
OK I have gone to school and learned about :Inheritance, Encapsulation & Polymorphism but to put it into practice I NEED to know some BASICS in how to structur, name and link .as files to .fla files correctly. The tutorials I find talk about oop and I practice exples and my code does nothing. so I started from scratch with the most barebones example: 1)create test.fla 2)create test.as 3) make sure test .as targets test.fla in the top right corner 4) in test.as I plug in these lines: Quote:
Last edited by evan; 11-10-2008 at 09:32 PM. Reason: update |
|
#2
|
||||
|
||||
|
I'm not exactly sure what you're doing. Are you setting this as the Document class? Or are you attaching it to an object?
|
| The Following User Says Thank You to Medyman For This Useful Post: | ||
evan (11-10-2008) | ||
|
#3
|
||||
|
||||
|
You have to call the .as files from the .fla.. in frame 1 actions layer put this:
Code:
#include "test.as" |
| The Following User Says Thank You to BLiZZaRD For This Useful Post: | ||
evan (11-10-2008) | ||
|
#4
|
||||
|
||||
|
Blizz, that would be true for AS2. I'm pretty sure Evan is using AS3 and CS3's OOP techniques.
|
| The Following User Says Thank You to Medyman For This Useful Post: | ||
evan (11-10-2008) | ||
|
#5
|
||||
|
||||
|
I think this would be a document class as in this would not be in a folder but reside in the same folder as the fla.
How is it different? I know partly because I have worked with other scripts but not on my own from scratch. if it's in a folder I think ithe file/class and folder need to be named the same. In this case I name the .as the same as the .fla and ensure they are linked via the upper right hand corner selector. |
|
#6
|
||||
|
||||
|
I'm not sure what you're referring to in terms of the "upper right hand corner selector". You could have workspace configured than I have mine, but I don't see anything related to relating AS classes in the upper right hand corner of my screen.
The Document class is set in the Properties panel. If you haven't already, watch the following tutorials by Lee Brimelow. I think they'll give you a better idea of using OOP techniques with AS. Introduction to OOP (AS2) Using the Document Class Object Oriented Scrollbar 1 Object Oriented Scrollbar 2 Edit: Are you using CS4 now?
|
| The Following User Says Thank You to Medyman For This Useful Post: | ||
evan (11-10-2008) | ||
|
#7
|
||||
|
||||
|
I did catch something I missed from the document class tutorial in the properties I forgot to set up the script in the Document class window. It figures it would be something dumb like that.
How do I create more than one script and appy it to an fla? Last edited by evan; 11-10-2008 at 09:31 PM. Reason: update |
|
#8
|
||||
|
||||
|
So attaching an external .as file is different in AS3? Or am I missing the actual question?
|
|
#9
|
||||
|
||||
|
Quote:
AS3 gets rid of the the # in front though. So, to include regular AS3, you might do something like: Code:
include "myactionscript.as" |
|
#10
|
||||
|
||||
|
hmmm... interesting. In 3 versions of Flash we went from not using .as at all to relying on them completely.. funny.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|