View Full Version : how to use classes for selfmade components
Gunjan
03-05-2007, 09:10 AM
Hi,
I have developed few components to reuse my codes (all codes in fla). It is very helpful for me. Now I want to use classes (compiled swc with as files) for my components. It is woking in normal fla files but whenever i compiled it into component it stops working without any error.
Plese help me how can i use classes to my components.
chintanbuch
03-12-2007, 07:29 AM
Hi there, i m not a flash guru but i was facing the same problem..
this is bcoz, your comp. may be using other libraries such as movieclip/graphics etc..
which are not included at the time of converting that clip to SWC...
but if u provide those libraries with ur compiled comp. it works fine..
Gunjan
03-13-2007, 05:41 AM
Hi,
Thanks for reply,
My question is how to use as 2.0 classes (self made ) in a selfmade component . My component is movieclip based but nothing is attached from library so if i am converting the main movieclip into swc file it automatically included all other movieclips except classes.
Waiting for any solutions,
Gunjan
wvxvw
03-14-2007, 12:12 AM
Rightclick the clip you want to be a component in the library, choose 'linkage', in the AS2 class textbox type the full classpath and classname of your class =)
Gunjan
03-15-2007, 07:05 AM
Thanx,
I have tried this, It is working normally,but when we save it as a swc file in component folder it doesn't work....
astgtciv
03-15-2007, 09:07 AM
I think you might need to refer to your classes in order for them to be exported somewhere in the swc. Try making an empty movieclip, and put code in its first frame that simply makes reference to your classes like
var classesReference:Array = [com.gunjan.Class1, com.gunjan.Class2, ...];
You don't even need all the classes, e.g., if Class1 refers to Class2 I think it should be enough to include Class1.
Gunjan
03-17-2007, 07:11 AM
thanks,
It is working. But when we write some code in frames it works on components or swc files ( a swc file is compiled clip). Why not it compiled the classes too as a swf file.
Is there a way....
Gunjan
astgtciv
03-17-2007, 09:41 AM
I totally didn't understand what you are asking, sorry, please clarify.
Gunjan
03-21-2007, 01:51 PM
I have a movieclip and I am using some classes for this. Then i exported it as a swc file ( in flash component folder). It is not working there.
Same thing but just write the code in inner frame of that movieclip and export as a swc file it is working.
I want to use classes for swc files.
astgtciv
03-22-2007, 06:14 AM
So referring to the classes as I have suggested from a frame code didn't solve the problem? If I remember correctly, an swc is simply a zip archive, you can look inside and there is a manifest file there which describes the contents of the swc...
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.