|
From: erixtekila <eri...@if...> - 2004-11-23 22:11:19
|
hi,
As I'm testing the framework, i'm aking what is the purpose of=20
assigning serializable member whatever you checked when using "Create=20
Class" command ?
Is it for the LocalConnection objet of the Asunit GUI window ?
Or only to link the movieclip datatype with its subclass ?
this is the result of creating a class without adding a movieclip=20
symbol.
<code>
import com.yourdomain.yourproject.*;
class YourClass {
public static var linkageId:String =3D=20
"com.yourdomain.yourproject.YourClass";
public static var classRef:Function =3D YourClass;
public function YourClass() {
}
=09
public static var serializable:Boolean =3D=20
Object.registerClass(linkageId, classRef);
}
</code>
So then, if we don't want to use "Add to Library as MovieClip" in the=20
xul alert command, we'll have necessary use "Prefix Class Name with=20
__Package".
So here my question :
Does the framework NEED a movieclip to extends ?
What is the preferred way to test class that are not belonging from=20
movieclips ?
Should we have to extend ALL Class from MovieClip Class ?
I know that the compiler creates such a "__Package." movieclip to=20
simulate package in flash and import the code with #init pragma before=20=
all vector initialized.
But since, we use class only code, what's the purpose of activating =20
"Prefix Class Name with __Package" ? The compiler will do it for you !
I must have missed something.
Can you clarify things a little on this.
And perhaps on the xul interface, there should have a radiobutton with=20=
the alternative of :
- "Add to Library as MovieClip"
or
- "Prefix Class Name with __Package"
or
- "Don't use MovieClip datatype automatic binding"
Perhaps, my misunderstanding comes from the first example you provide=20
in the README.txt :
<excerpt>
---------------------------------------
QUICKSTART INSTRUCTIONS:
---------------------------------------
(...)
- Select:
"Automatically Open New Files"
"Add to Library as MovieClip"
"Add new Test
and be sure that "Prefix Class Name with __Packages" is =
deselected.
</excerpt>
Why do we have to check "Add to Library=85" since ExampleClass won't be =
a=20
MovieClip ?
The tests are not oriented to test is MovieClipness=85 ;=ACp
Help me on this please.
Thanx a lot.=
|
|
From: Luke B. <lb...@gm...> - 2004-11-24 01:11:02
|
Hey There, You're absolutely right to be confused, this matter is very confusing... I'm going to try to separate this problem into smaller peices if I can. Basically, what we're talking about is MovieClips. Because of the rendering Engine built into Flash, we can logically break up any objects in a Flash Application into 2 types: 1 - MovieClip 2 - Non-MovieClip. The only major difference between MovieClips and Non-MovieClips is that you must use the MovieClip Factory (MovieClipInstance.attachMovie(args); ) to actually instantiate a MovieClip and have it render on Stage. *You CAN instantiated classes that extend MovieClip without using this factory, but they won't render because they're not a member of the composite MovieClip structure that begins at Stage. Within the MovieClip type, there are actually 2 subtypes based on their definition. 1 - MovieClips that exist in a .FLA library as a Symbol 2 - MovieClips that exist only as an ActionScript file that extends MovieClip MovieClips that exist in a .FLA library, do not need any linkageId, classRef or serializable properties as they will be imported when the .FLA is compiled. In order for MovieClips that exist only in ActionScript to be imported into a Library and registered as a valid "attachable" (and actually a "serializable") element, one must call Object.registerClass(someUniqueLinkageId, theConstructorOrClassDefinition)... We provide access to this "hack" using relatively elegant (methinks) solution by storing the result of the registration in a static member named, "serializable"... This registration can also apply to non-MovieClip classes that you would like to store in LocalSharedObjects, RemoteSharedObjects and LocalConnectionObjects... There are at least two reasons to extend MovieClip in your Class definition: 1) You want the compiler to not fail when you try to access the Methods and Properties of the MovieClip object. 2) You want your IDE (PrimalScript) to provide code hinting for member methods and properties that exist on MovieClip. Basically, what we're trying to expose in our "Create Class" command is the ability for people to: 1) Create Classes that are NOT MovieClips 2) Create Classes that are MovieClips and exist in the Library 3) Create Classes that are MovieClips and don't exist in the Library Unfortunately, our Template code is very simple and inelegant and we have a priority to try and keep it that way. So our auto-created TestCase does not actually instantiate MovieClips properly - hence the example to show folks how that might be done using a more efficient factory. (Found on TestCase) I agree wholeheartedly that our User Interface should show some exclusivity on these selections, and would be glad to see your suggested improvements. It's a little difficult because Macromedia did not give us a complete "XUL" implementation, they just gave us a XUL "Dialog" - but in spite of that, I think that what you're asking for could be implemented. Please let me know if this does or does not answer your question. Thanks, Luke Bayes www.asunit.com |
|
From: Luke B. <lb...@gm...> - 2004-11-29 22:07:36
|
------------------------------ This message was from erixtekila but was unable to be sent through the list because of attached Images I've posted the images to the web server and replaced them with links. Thanks so much for taking to time to take these captures, I'll add links to them in the built-in readme as well. Luke Bayes www.asunit.com ------------------------------ Hi Luke, Thanx for this clear and clean explanation. In fact, your comparison on MovieClip type vs Class is a daily basis for .as developpers. The need you felt to explain things in such a detail way, should come from my bad question. I apologize. What I was (trying to) saying is just : what is the workflow when using asunit framework ? I anderstand now that the poor xul implementation of MM drive you to deal with UI difficulties. So my feeling is that a little documentation should clear things a little. When one will try to implement the framework, they'll get trouble. I tell you what i've anderstood, see inline screenshots : - Hide quoted text - > Basically, what we're trying to expose in our "Create Class" command > is the ability for people to: > > 1) Create Classes that are NOT MovieClips http://www.asunit.com/docs/img/simpleclass.jpg > 2) Create Classes that are MovieClips and exist in the Library http://www.asunit.com/docs/img/extendsmovieclip-lib.jpg > 3) Create Classes that are MovieClips and don't exist in the Library http://www.asunit.com/docs/img/extendsmovieclip-nonlib.jpg Am I right ? In my experience of using asunit, that's work just fine. > Unfortunately, our Template code is very simple and inelegant and we > have a priority to try and keep it that way. So our auto-created > TestCase does not actually instantiate MovieClips properly - hence the > example to show folks how that might be done using a more efficient > factory. (Found on TestCase) I think that the TestCase example shouldn't mention to check "Add Library=E2=80=A6". To finish, i would like to thank you work, which is really valuable. Actually, i find the serialisable property and the Object.registerClass really wonderfull. > > We provide access to this "hack" using relatively elegant (methinks) > solution by storing the result of the registration in a static member > named, "serializable"... This registration can also apply to > non-MovieClip classes that you would like to store in > LocalSharedObjects, RemoteSharedObjects and LocalConnectionObjects... In fact, it is really elegant=E2=80=A6 Anyone should implement its class with this, in case of future code refactoring. > > I agree wholeheartedly that our User Interface should show some > exclusivity on these selections, and would be glad to see your > suggested improvements. It's a little difficult because Macromedia did > not give us a complete "XUL" implementation, they just gave us a XUL > "Dialog" - but in spite of that, I think that what you're asking for > could be implemented. Is there a comboBox in the XUL of MM ? That way, you could make : - "Create simple Class" as defalut value. - "Create and subclass library MovieClip" as 2nd one - "Subclass MovieClip Class without library symbol (Advanced use only)" as 3rd. My 2cents. Cheers. |