Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-06-2009, 06:39 PM   #1
elliotlarson
Registered User
 
Join Date: Nov 2009
Posts: 3
Default Vector Art to ActionScript 3 Shape Code

Is there a way to take a vector graphic and translate it to ActionScript 3 shape code? I'd like to be able to create a graphic in Illustrator, and then instead of embedding or importing it into Flash, I'd like to draw the shape with AS3 shape code.
elliotlarson is offline   Reply With Quote
Old 11-06-2009, 06:47 PM   #2
Greg SS
Uber sleepy
 
Join Date: Nov 2007
Location: Bandung
Posts: 886
Send a message via Yahoo to Greg SS
Default

http://flash-creations.com/notes/sample_svgtoflash.php
__________________
My help efforts are postcardware.
PM me for my local address to send your postcard if you're kind enough to indulge my weird hobby.
Greg SS is offline   Reply With Quote
Old 11-06-2009, 07:07 PM   #3
elliotlarson
Registered User
 
Join Date: Nov 2009
Posts: 3
Default

That's pretty cool, but it doesn't give you the code used to draw the SVG images, rather it imports the XML data from an SVG file and then uses AS3 drawing tools to draw the shape. What I'm hoping for is a tool that will give me the actual code for a vector graphic.

For example, say I've drawn an arrow in Illustrator. I'm looking for a tool that will take it and give me output like this that I can then copy and paste:

graphics.lineStyle(1, 0, 1);
graphics.beginFill(0xffffff);
graphics.moveTo(-50, -25);
graphics.lineTo(0, -25);
graphics.lineTo(0, -50);
graphics.lineTo(50, 0);
graphics.lineTo(0, 50);
graphics.lineTo(0, 25);
graphics.lineTo(-50, 25);
graphics.lineTo(-50, -25);
graphics.endFill();
elliotlarson is offline   Reply With Quote
Old 11-06-2009, 07:15 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

No, there is no such thing as far as I am aware...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-06-2009, 07:17 PM   #5
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,879
Send a message via Skype™ to henke37
Default

You should really use the bulk loading api if you have imported a shape, it will load much faster.
henke37 is offline   Reply With Quote
Old 11-06-2009, 07:37 PM   #6
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

I have this for Fireworks vectors:
http://www.senocular.com/fireworks/e...ns.php?id=0.54
__________________
(6)
senocular is offline   Reply With Quote
Old 11-06-2009, 08:56 PM   #7
elliotlarson
Registered User
 
Join Date: Nov 2009
Posts: 3
Default

Thanks, senocular. That's pretty much exactly what I was looking for. Perfect!
elliotlarson is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:24 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.