View unanswered posts | View active topics



Reply to topic  [ 15 posts ] 
Components with FD and MTASC 
Author Message
Member

Joined: Tue Jan 31, 2006 3:54 am
Posts: 5
I am a component developer who is running into some problems. My customers want to use FD, my components and MTASC to make their projects.

They say the need the source code files to compile with mtasc otherwise mtasc throws errors (something about intrinsic type checking). I have had only one customer say it's possible to use my components with mtasc but did not indicate how. I cannot give the source code due to some contracts that I have to work out. I really want to help them.

Can someone please, for the sake of my customers tell me how to setup a project in FD that uses components and is compiled using mtasc?

My experience level with FD and mtasc is very little. I have been over this forum for the last few hours and have not found any examples of this to my dismay. TIA


Sun Feb 26, 2006 9:09 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
I think your client only needs intrinsic classes. You can use <FD>/tools/IGen to generate these intrinsic classes from you component's classes. So they won't have any code, only declarations required for MTASC so they can include your component in their project.

If you distribute your component as a SWC, then you can rename the .SWC to .ZIP and you'll find these intrinsic classes inside too.


Sun Feb 26, 2006 9:42 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
To use a "closed source" component (MM components or third party SWC):

1. Drop the components you need on stage and remove them. They will be included in the SWF library.
2. Publish the SWF and in FlashDevelop: right-click on the file and select "Add to Library".
3a. If you are using MM components, make sure you select "Use MX" in the project compiler options.
3b. If you are using a third party SWC, you need to add the component's intrinsic classes to your project classpath.
4. Now you can use the components in your FlashDevelop project :)


Sun Feb 26, 2006 9:59 pm
Profile WWW
Member

Joined: Mon Mar 13, 2006 4:06 am
Posts: 3
Post 
How would you then create a component in the code?


Tue Mar 14, 2006 5:43 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
See: Application Development with MTASC / First Steps.
Read also: How createClassObject comes to be.


Tue Mar 14, 2006 9:31 am
Profile WWW
Member

Joined: Thu Mar 02, 2006 9:33 pm
Posts: 5
Post 
Is there a way to use the TableMaker extension? (http://www.flashrelief.com/tablemaker/features.html)

It's an extension that installs a component--the problem is, I don't know where the swc is or where the intrinsic classes are after installing the extension.


Fri Apr 14, 2006 5:09 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
marcus wrote:
Is there a way to use the TableMaker extension? (http://www.flashrelief.com/tablemaker/features.html)

It's an extension that installs a component--the problem is, I don't know where the swc is or where the intrinsic classes are after installing the extension.

You have to find the SWC (maybe in some folder in you Document & settings).

Then rename the .SWC to .ZIP. It should contain the component's intrinsic classes needed to build your project and a SWF file to be added to you library. Well... I'm not 100% sure but it should work that way.


Sat Apr 15, 2006 12:07 pm
Profile WWW
Member

Joined: Thu Mar 02, 2006 9:33 pm
Posts: 5
Post 
Ok, for future reference, here's how I did step 3b above:

1. I found the TableMaker.swc file (make sure you're searching within hidden files if you're on Windows XP

2. Renamed it TableMaker.zip

3. Extracted the .asc files (com.tablemaker.MakeRectangle.asc, com.tablemaker.Table.asc, com.tablemaker.TableParse.asc)

4. Renamed them to MakeRectangle.as, Table.as, TableParse.as

5. Created the folder com/flashrelief in my classpath and moved the files into it

6. Selected "always compile" in the context menu of Table.as (only this file) in the FlashDevelop project explorer.

7. Used this code in my .swf
_root.attachMovie("TableMaker", "table_mc", 4);
var aTable = _root.table_mc.createFromString(myString);

Hope that helps someone.


Mon Apr 17, 2006 3:58 pm
Profile
Member

Joined: Fri Aug 25, 2006 10:38 pm
Posts: 9
Location: Poland
Post 
Hi, I'm quite noob in developing and I've got a question about using MM components with FD.

I did what you wrote Philippe, I selected "Use MX" and component works fine.
But when I select that option, the rest of my movie doesn't work!

I don't know what's that option for, I couldn't understand its description, but I'd like to know if there's any way to use MM component without selecting that option or making rest of the movie to work.

Sorry for my english, hope you understand me ;)


Last edited by chester on Fri Aug 25, 2006 11:01 pm, edited 2 times in total.



Fri Aug 25, 2006 10:46 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
chester wrote:
Hi, I'm quite noob in developing and I've got a question about using MM components with FD.

I did what you wrote Philippe, I selected "Use MX" and component works fine.
But when I select that option, the rest of my movie doesn't work!

I don't know what's that option for, I couldn't understand its description, but I'd like to know if there's any way to use MM component without selecting that option or making rest of the movie to work.

Sorry for my english, hope you understand me ;)

UseMX is for MTASC compiler -mx switch. This option tells the compiler to ignore the classes in the mx package (ie. the MM components classes which come with the Flash IDE). This is required because MTASC doesn't like the loose programming style of these classes.

Now, for your problem: maybe your use some classes from the mx package in your code? If these classes where not included in your library SWF, they will not be present in the final SWF.


Fri Aug 25, 2006 10:56 pm
Profile WWW
Member

Joined: Fri Aug 25, 2006 10:38 pm
Posts: 9
Location: Poland
Post 
In my project I use Delegate and EventDispatcher.


I tried now to do attachMovie("UIScrollBar"...) after adding swf to library and it works now, but I get dozens of errors, like:

Warning : The MovieClip Defaults needs the class mx.skins.halo.Defaults which was not compiled :
Please force compilation of this class by adding it to the commandline

any help?


Fri Aug 25, 2006 11:04 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Post 
chester wrote:
In my project I use Delegate and EventDispatcher.


I tried now to do attachMovie("UIScrollBar"...) after adding swf to library and it works now, but I get dozens of errors, like:

Warning : The MovieClip Defaults needs the class mx.skins.halo.Defaults which was not compiled :
Please force compilation of this class by adding it to the commandline

any help?

Try importing the Delegate & EventDispatcher classes in the library SWF so they will be ready in your final SWF.

And search the forum(s)/lists about how to use MM components with MTASC - attachMovie can not be used to attach MM components on stage.


Fri Aug 25, 2006 11:21 pm
Profile WWW
Member

Joined: Tue Oct 31, 2006 1:09 pm
Posts: 5
Location: Germany
Hello Guys,

many thanks to you (Philippe, Nick, and the others) for providing FD. I read through this thread, but it didn't bring me to a solution. Maybe you can help me. I would like to have scrolling text, so I am using the one from playground (http://play.ground.gr/?p=85). I tried to rename the files inside the swc to as-extension (they were asi not asc in orig. that's a prob?), put in classpath, etc.
Then I try to instantiate with different methods like marcus above (createFromString), or the MMComponents example, but I am sure wrong. Does anybody here know how to do that or knows a free textscroller that can be used with FD only? Any help would be greatly appreciated. Thank you and keep up the good work.

Regards
Gope


Tue Oct 31, 2006 1:16 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11691
Location: Paris, France
Gope wrote:
Hello Guys,

many thanks to you (Philippe, Nick, and the others) for providing FD. I read through this thread, but it didn't bring me to a solution. Maybe you can help me. I would like to have scrolling text, so I am using the one from playground (http://play.ground.gr/?p=85). I tried to rename the files inside the swc to as-extension (they were asi not asc in orig. that's a prob?), put in classpath, etc.
Then I try to instantiate with different methods like marcus above (createFromString), or the MMComponents example, but I am sure wrong. Does anybody here know how to do that or knows a free textscroller that can be used with FD only? Any help would be greatly appreciated. Thank you and keep up the good work.

Regards
Gope

I wrote a quick tutorial on using SWC components.

This component gave me a hard time (I had to decompile it) figuring out how to use it without the Flash IDE... It was really not meant to be attached by script.
Code:
// scrollbar and textfield must have the same parent...
var target:MovieClip = _root;
// target textfield
var field:TextField = target.createTextField("field_txt", 0, 0,0, 200, 200);
// dummy text
for (var i=0;i<20;i++) field.text += "ligne "+i+"\n";

// scrollbar creation parameters
var init = {
   _x:field._x+field._width,
   _y:field._y,
   skin:"", // this is THE problem
   _targetInstanceName:field._name // required to size the scrollbar
}
// create scrollbar
var scr:TextScroller = TextScroller(target.attachMovie("TextScroller", "src_mc", 1, init));


Other "less clean" solution (so you can have a different parent clip):
Code:
// scrollbar and textfield CAN have a different parent
var target:MovieClip = _root;
// target textfield
var field:TextField = target.createTextField("field_txt", 0, 0,0, 200, 200);
// dummy text
for (var i=0;i<20;i++) field.text += "ligne "+i+"\n";

// scrollbar creation parameters
var init = {
   _x:field._x+field._width,
   _y:field._y,
   skin:"" // this is THE problem
}
// create scrollbar
var scr:TextScroller = TextScroller(target.attachMovie("TextScroller", "src_mc", 1, init));

// set target textfield
scr.targetTextField = field;

// ugly hack to resize the component:
scr._targetInstanceName = "foo";
scr["setSize"]();


Tue Oct 31, 2006 3:46 pm
Profile WWW
Member

Joined: Tue Oct 31, 2006 1:09 pm
Posts: 5
Location: Germany
:D I am very thankfull for that code and the explanation. Of course it is working and the funny part is that Igor (Developer of the Scrollbar component) wrote me a reply. He said he thinks it's not possible without the source... So Philippe, many thanks to you.
I also "contributed" to your project (Initials: G.P.) as I really want to support you and show you that people are appreciating the time you spent for them.

Thanks a lot!

Btw. did you think about implementing SourceSafe (or other CVS) support? I was thinking about writing provider for TeamSystems but it seems that almost nobody is using it... too expensive! :(
Anyways I will might have a look into your plug-in section and write a little .net VSS provider in the next year...

CU
Gope


Wed Nov 01, 2006 4:53 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.