Re: [flexcoders] Re: Importing SWC Files in FLEX
Hi John & Danny Thanks for your help. Problem has been solved , there were some missing libraries in my Flex compiler. I uninstalled the complete package and re-installed it, and I can access SWC files using my code now. Appreciate your help Anuj On Sun, May 25, 2008 at 4:19 AM, John McCormack <[EMAIL PROTECTED]> wrote: >Hi Anuj, > > //"An internal build error has occurred. Right-click for more information." > I had difficulty in understanding exactly what was needed to use Flash > assets and had similar errors. It doesn't help when the documentation > varies so much on what to do. Unfortunately the Adobe PDF's have no > publishing date written inside and so you often get information > from out-of-date ones. > > I am able to use Flash Assets but my projects are all ActionScript > projects rather than Flex projects. As a result I do not have to turn the > asset into a Flex component by making it an extension of the UIMovieClip > class. For example, on the stage I have a red dot with a radial gradient. I > make it into a symbol and it goes in the library. It has to be either a > button or MovieClip. Say I call it RedDot. I can delete the one on the > stage. When I publish I make sure the SWC box is ticked in the publish > settings. In Flex Builder 3 I right click the project, go to build options > and add the swc. If I then type var rd:, suddenly RedDot is on the list of > types I select it and hit return. So I finish up with var rd:RedDot = new > RedDot and I can addChild(rd) and that's it. > > With Flex projects the only difference is that Flex needs to give the mxml > compiler access to RedDot. It does this by agreeing an interface to it - > this is just a set of agreed functions/methods that both sides agree on. > This is the UIMovieClip - UserInterfaceToMovieClip (probably). So in Flash > my RedDot has to extend UIMovieClip. If you have already done this, > right-click the symbol in the library and check the properties to see this. > If not, select the symbol and go to the Commands menu in Flash and choose > Convert symbol to Flex component. This has three consequences, which you can > just do manually yourself: > > 1. The fps is set to 24. > 2. The Base Class is set to mx.flash.UIMovieClip. > 3. The FlexComponentBase is added to the library. > > Note: I have just checked and found that the library symbol must have > export for actionscript ticked *before* you Convert it, otherwise it > doesn't do it. Now you can either right-click the symbol and export the swc, > or publish and produce the swc. I have a swf with five symbols in it and > when published my swc has five symbols in which I can use in Flex. I suggest > you draw the simplest graphic, turn it into a MovieClip symbol for the > library. Make sure export for actionscript is set in the library symbol. > Select it and Convert to a Flex Component. Check the properties for the > UIMovieClip class. Publish with SWC ticked. Import it, and it should be > available. You don't need to write a class to go with it since Flash > produces its own cutdown class for it when ti doesn't find one. > > I got the above error when I followed various guidelines and tried to do > something more complicated. > > Fingers crossed for you! > > John > >
Re: [flexcoders] Re: Importing SWC Files in FLEX
Hi Anuj, //"An internal build error has occurred. Right-click for more information." I had difficulty in understanding exactly what was needed to use Flash assets and had similar errors. It doesn't help when the documentation varies so much on what to do. Unfortunately the Adobe PDF's have no publishing date written inside and so you often get information from out-of-date ones. I am able to use Flash Assets but my projects are all ActionScript projects rather than Flex projects. As a result I do not have to turn the asset into a Flex component by making it an extension of the UIMovieClip class. For example, on the stage I have a red dot with a radial gradient. I make it into a symbol and it goes in the library. It has to be either a button or MovieClip. Say I call it RedDot. I can delete the one on the stage. When I publish I make sure the SWC box is ticked in the publish settings. In Flex Builder 3 I right click the project, go to build options and add the swc. If I then type var rd:, suddenly RedDot is on the list of types I select it and hit return. So I finish up with var rd:RedDot = new RedDot and I can addChild(rd) and that's it. With Flex projects the only difference is that Flex needs to give the mxml compiler access to RedDot. It does this by agreeing an interface to it - this is just a set of agreed functions/methods that both sides agree on. This is the UIMovieClip - UserInterfaceToMovieClip (probably). So in Flash my RedDot has to extend UIMovieClip. If you have already done this, right-click the symbol in the library and check the properties to see this. If not, select the symbol and go to the Commands menu in Flash and choose Convert symbol to Flex component. This has three consequences, which you can just do manually yourself: 1. The fps is set to 24. 2. The Base Class is set to mx.flash.UIMovieClip. 3. The FlexComponentBase is added to the library. Note: I have just checked and found that the library symbol must have export for actionscript ticked before you Convert it, otherwise it doesn't do it. Now you can either right-click the symbol and export the swc, or publish and produce the swc. I have a swf with five symbols in it and when published my swc has five symbols in which I can use in Flex. I suggest you draw the simplest graphic, turn it into a MovieClip symbol for the library. Make sure export for actionscript is set in the library symbol. Select it and Convert to a Flex Component. Check the properties for the UIMovieClip class. Publish with SWC ticked. Import it, and it should be available. You don't need to write a class to go with it since Flash produces its own cutdown class for it when ti doesn't find one. I got the above error when I followed various guidelines and tried to do something more complicated. Fingers crossed for you! John
[flexcoders] Re: Importing SWC Files in FLEX
Hey Anuj, People tend to respond more to questions that have enough info to get to the root of the problem such as coding issues. This one is more of a system issue and perhaps I'm still missing some info because I don't understand exactly what you're trying to do, and it's tough to post your "environment". (I'm still feeling a bit jilted that nobody answered my question some time ago about browser scrollbars ;-) You SHOULDN'T be able to "look at swc file in the browser". You should be able to add the swc to the lib path of your project and then have access to those components (those inside the swc) in the design view in the custom folder. If you have added it, and can see the components in the custom tab of the design view then perhaps there is something wrong with your swc? I would suggest getting a well known swc, say flexlib.swc, and adding it to your lib path, and trying to use some elements from it. If that works okay, then look to your swc as the problem. Where did you get the swc? What type of component in the swc are you trying to use? Do you get build errors when you use any symbol or component? If it's a visual component, are you sure it should be visible in the application view you put it in? --Danny
Re: [flexcoders] Re: Importing SWC Files in FLEX
Hi Danny Thanks for the reply. That's the confirmation that the list is receiving my emails :-). Danny I imported swc and I can see that component in the custom component folder and I can drag to drop in the design view. However When i compile my application that component is not visible in the browser and sometimes it gives compiler error "An internal build error has occurred. Right-click for more information." I am not sure what's going on . It should be very simple to import flash shapes and components in Flex but I am new to Flex world which might be causing such naive errors. Please let me know if you find the solution. I need to look at SWC file in the Browser while executing the application. By googling , some folks recommended to check the library path and some say try to compile the application using command line. Few folks have just reinstall the whole builder too. Please let me know if you have found any missing link. Again I appreciate your help Thanks Anuj On Fri, May 23, 2008 at 12:02 PM, Danny Venier <[EMAIL PROTECTED]> wrote: >Hi Anuj, > > > > > > You can try Import/FlexBuilder/Artwork and point to a swf or swc? > > > > Or….you can add a swc to your project by adding the swc to your project > properties build path. (use project/properties/FlexBuild Path and open the > Library path tab, then add swc.) > > > > Not sure what environment you have set up or exactly what you're doing, or > trying to do, but try that, or review the docs again… > > > > --Danny > >
[flexcoders] Re: Importing SWC Files in FLEX
Hi Anuj, You can try Import/FlexBuilder/Artwork and point to a swf or swc? Or..you can add a swc to your project by adding the swc to your project properties build path. (use project/properties/FlexBuild Path and open the Library path tab, then add swc.) Not sure what environment you have set up or exactly what you're doing, or trying to do, but try that, or review the docs again. --Danny