Vector Graphics

Hi, With the SWF library integration to NME I was under the impression that I would be able directly use my Adobe Illustrator graphics, make a MovieClip (with the export to actionscript checked and a name given) and then simple create new instances of …

Viewing 1 to 6 (6 Total)
Vector Graphics

wtsnz

wtsnz
Total Posts: 74
Joined: September 11, 2011

Hi,

With the SWF library integration to NME I was under the impression that I would be able directly use my Adobe Illustrator graphics, make a MovieClip (with the export to actionscript checked and a name given) and then simple create new instances of these for my applications.

I've not had any luck with this so far, I keep getting "SWF.hx:346 Unknown sub tag: Protect".

I've also tried creating a circle inside flash, converting to movieclip and exporting it. This works when I compile my application to flash, but not to WebOS (Not tried iOS yet)

Has anybody else managed to get their Illustrator Vector art exported, and working correctly in their NME apps?

Tags:
Posted on March 07, 2012 at 12:23 AM

wtsnz

wtsnz
Total Posts: 74
Joined: September 11, 2011

Re: Vector Graphics

Just bumping the thread.

The swf stuff does not seem to work when compiled to WebOS, just crashes the app.

Posted on March 09, 2012 at 11:48 PM

singmajesty

singmajesty
Total Posts: 2140
Joined: August 25, 2011

Re: Vector Graphics

If you wouldn't mind creating a simple sample of something that is failing, I can take a look.

The SWF library does work on webOS. Actually, if you could send both a sample of the converted object which crashes on webOS, and of the original from Illustrator that wouldn't compile, I can investigate. Usually the issue is something small

Posted on March 12, 2012 at 12:27 PM

singmajesty

singmajesty
Total Posts: 2140
Joined: August 25, 2011

Re: Vector Graphics

I just added the Protect tag to the list of tags to ignore, and committed the change to SVN. If you wouldn't mind testing the change yourself, I'd love to know if this fixes compatibility with your graphics. When I export from Illustrator it does not appear to include this tag, but I didn't password protect my SWF. It should be reasonable to ignore this tag anyway, however, since this password is supposed to be respected by editors, not by renderers.

Open up /format/SWF.hx, and at line 342 (just before defaultsmiling, add "case Tags.Protect:"

This means that when it encounters a Protect tag, it will handle it (and do nothing), rather than throwing an error that it doesn't recognize the tag.

Posted on March 12, 2012 at 9:48 PM

wtsnz

wtsnz
Total Posts: 74
Joined: September 11, 2011

Re: Vector Graphics

Just come across your reply mate, I will check it out later when I get home!

I have also managed to get a sample to compile for iOS, and it 'kinda' works. The star shape I made in flash, and exported, once added to the stage, the star's opacity seems to be random, sometimes it is displayed, sometimes it isn't. It's really weird!

More when I get home!

Will

Posted on March 13, 2012 at 7:11 PM

singmajesty

singmajesty
Total Posts: 2140
Joined: August 25, 2011

Re: Vector Graphics

Whenever you add a filter to an object, there's a blob of bytes that represent that filter inside of the SWF. When this data is not processed properly (like it wasn't before), it can mean that when the parser tries to read other properties of the object, its reading from the wrong place.

For example, if the filter's data is 5 bytes, you (at the very least) need to move the position forward by 5 bytes or else you will be reading your filter data as if it were something else... which doesn't really work ;)

That is probably why you had issues with objects disappearing. It should be a lot better now smiling

Posted on March 13, 2012 at 7:27 PM