View Full Version : Distorted Shapes when making a movieclip?
midimid
09-30-2009, 05:31 PM
I have a huge collection of assets that are converted to MovieClips via the JS FL API. The assets are first imported from Illustrator. In Flash, these are imported as graphic symbols with just generic fills only, but some are quite complex (its for maps).
If I build the SWF without doing anything, the outputted SWF looks great. I right-click zoom in with the flash player, and I can see that everything is as it should be.
But when I convert everything to separate MovieClips - either by breaking apart the graphic symbols first, or leaving them as-is - the outputted SWF has many of the shapes distorted by more than a few pixels. They appear somewhat skewed or slightly smaller, leaving gaps where there should be none.
Even if I single out the culprit symbols and convert only those to MovieClips, I still get the same distrortions.
Any thoughts on what could be causing this?
Note that I've tried numerous ways to get these vector assets into Flash, but the result always has distortions, each method producing somewhat different distortions. Either via Illustrator, or making a SWF and then decompiling it...etc.
snickelfritz
09-30-2009, 06:55 PM
I just prototyped a simple map in AI, imported it to a MovieClip in Flash; no gaps or graphical issues.
Here's the process I used:
Build the map in Illustrator, with each "county" or region on a separate layer.
ie: a map of the USA would have 50 layers.
Include the text labels, etc... for each county on that county's layer.
Save the file in AI format.
In Flash CS3, Insert > New Symbol... choose MovieClip; give it a Class name of "Map".
Import the AI file to the stage within Map as keyframes.
Exit edit mode to Scene1.
You should now have a MovieClip in the Library, class name "Map", with the counties on keyframes in sequence along the timeline.
This single MovieClip symbol will be used to create every county on your map.
Frame1, actions layer, on the main timeline:
var m:Map = new Map();
var n:int = m.totalFrames;
m = null;
var counties:Array = new Array();
for (var i:int = 0; i < n; i++)
{
var county:MovieClip = new Map();
county.x = stage.stageWidth/2;
county.y = stage.stageHeight/2;
county.gotoAndStop(i+1);// move to next county on the timeline
county.buttonMode = true;
county.id = i;
county.addEventListener(MouseEvent.MOUSE_OVER, onOver);
county.addEventListener(MouseEvent.MOUSE_OUT, onOut);
counties.push(county);
addChild(county);
}
function onOver(e:MouseEvent):void
{
MovieClip(e.currentTarget).alpha = .5;
}
function onOut(e:MouseEvent):void
{
MovieClip(e.currentTarget).alpha = 1;
}
midimid
09-30-2009, 07:45 PM
Man I love this forum - trying keyframes is brilliant.
Out of curiosity - did you have the same issue when having everything on one frame, each county still in its own layer? Cause that's what I'm doing. I've noticed that depending on which clips exist or not, the distortions differ, so it would seem to me that the player is the error maker here.
My only worry about this method is the overhead that might occur with having thousands of frames as the whole purpose of this project is to have an extremely small filesize when compared to using shapefiles. Yes, unfortunately, Illustrator was still not actually the original source but I didn't want to complicate the question.
But will give the multiple frames idea a shot and reply back if its a success. Thanks.
midimid
09-30-2009, 08:29 PM
I actually have another way that has ended up working for me. I'm going to continue with it since I'm already half way done - but will definitely come back to snickelfritz's method afterwards.
Instead of exporting with fills and strokes, I'm only exporting strokes. I'm then filling the strokes manually - takes about a minute or two per map set plus doublechecking that I didn't miss any.
My method for building MovieClip instances is already scripted using the JS FLA API, so that's not a problem.
The result still has distortions, but they are much smaller and much fewer. As long as I make the stroke large enough (~0.5, normal scaling, rather than what I'd prefer - hairline/none) the distortions are nearly invisible.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.