FXG is not supported inline in MXML (in this release). you'll need to
manually convert the FXG to MXML tags by changing the namespace and
moving a few things around (move the Library tag to the top of your
MXML file). Or, use Catalyst to convert from FXG to MXML.
Thank you soooooo much for answering....
I don't quite understand.
Without Catalyst, should I just bring up the FXG in a text editor and manually change the tags (ex...<Graphics>) to MXML tags?
Is there a way to make Flash Builder Beta 2 do it?
Are there any complete instructions on this?
Sorry to be winded.....
I have a AI artboard/file that has some graphic elements and text elements that I need to populate in a List component as a repeatable item from fetched data from PHP. So I would like to bring it in the as part of the Skin or ItemRenderer (not 100% sure which one I can bind data to) and DYNAMICALLY change about 5 fields/labels for each record returned from my result set and shown in the List component. I have about 20 pages that have been rendered in AI and I need to make pages out of them. Since the AI files already have the layout of the text and graphics, I thought it would be much easier to move them in by copying the FXG code out of AI by using the Show Code button rather than fully saving the FXG file. I am under the impression that if I try to bring the FXG in as a component that I can no longer bind any of the text to actual data returned from the PHP program. For example I have a date value (in text in AI file) in the FXG graphics. There is a date value in the data records I am pulling from PHP. In the list I want to substitute the date text in my AI\FXG file by making it a RichText or something in Flex and then binding it to the field in each record returned and seeing the date from the record in that place when I display the List component. If 10 records come back from server, the List component will show 10 items, and each of those items may have a different date from the 10 records.
THANK YOU THANK YOU THANK YOU for your help...from the forums and different tutorials, this is not very clear.
You could additionally map the default namespace prefix to the spark component namespace:
And yes, as Ely said, should be at the bottom).
Hey Peter, Again I REALLY appreciate your help....
So, Are you saying if follow the below process steps it will work?
1. Copy of code from AI Save as FXG dialog box using the Show Code button.
2. Open the Skin or ItemRenderer in Flash Builder Beta 2. (which one should I use to be able to BIND data, skin or itemrenderer)
3. Paste the code in AT THE BOTTOM (after the Skin or ItemRenderer) (tags will still be in <Graphic> format NOT <s:Graphic> format)
4. Move the Library tags to the top of pasted code.
5. Save the file in Flash Builder that it will convert the tags to (s:xxxxxxx) type tags>
IF this is wrong, please explain..I apologize, trying to pick this up as fast as I can...Solving this problem would allow me to move very quickly in creating the pages I have to.
Not knowing Flex 4 well enough, it would take considerably more time if I had to save each individual OBJECT from AI and export as png or jpg or gif.
I also would have to recreate the layout from scratch which would also be difficult at my current knowledge level.....
Thank you again Peter......
That process should work - but I don't think Flash Builder converts tag to use MXML 2009 + Spark namespaces...
I will convert the FXG tags to MXML tags outside of Flash Builder in notepad or something and the paste into Skin or ItemRenderer.
Regarding my question as to where to paste the code Skin or ItemRenderer?
Also, MVC architechture?
If your FXG is just a set of graphical components, then they don't need to be part of a Skin or an ItemRenderer at all. If they are intended to be a skin of a component, like of a Button, then put them in a Skin and use that to skin your component. If they are intended to represent a data item, then make it an ItemRenderer.
FXG (and MXML Graphics) should just be thought of as an easy way to represent drawing primitives in XML, which helps make it more readable and more toolable. What you do with those graphical objects depends on your use-case.