Solved

Export from Illustrator to Flash problem with multiple groups and selection

Posted on 2012-04-01
5
605 Views
Last Modified: 2012-04-23
New to both Flash and Illustrator, I have a vector graphic in Illustrator.  It was originally created in Adobe Ideas and emailed as PDF, imported to Illustrator and saved as AI file.  The file has a single layer with three groups, one for the outline, one for coloring, and a third for shading.  I'm importing this AI file into flash.

AI file comes over fine and looks great.  Within Flash, I'm trying to allow users to move/resize the image using Senocular's excellent transform tool:

http://www.senocular.com/flash/actionscript/?file=ActionScript_3.0/com/senocular/display/TransformTool.as

The problem is when I go to select the image, I only get one of the groups (either the lineart, color, or shading) and so when I try to move or resize the image "comes apart".

Because I will be moving and resizing I need to maintain the image as a vector.  I've tried exporting from Illustrator as an EMF file and then importing into Flash.  This solved my problem, but it decreased the image quality and created a few artifacts here and there.  I'd like to maintain the vector image quality, but not treat each group as a separate object.  

I tried to merge the groups in Illustrator but ran into problems because one of the groups (shading) has a different alpha-channel value than the others.  

Here's the code I'm using for selection:

import flash.display.Shape;
import com.senocular.display.TransformTool;

// default tool
var defaultTool:TransformTool = new TransformTool();
addChild(defaultTool);

// keep track of the current tool being used
var currTool:TransformTool = defaultTool;

// selecting objects on the screen
function select(event){
	if (event.target is Stage) {
		currTool.target = null;
	}else if (event.target is MovieClip) {
		currTool.target = event.target as MovieClip;
		toolInit();
	}
}

// for setting a new tool
function toolInit():void {
	// raise
	currTool.parent.setChildIndex(currTool, currTool.parent.numChildren - 1);
}

// event handlers for selecting objects and changing tools
stage.addEventListener(MouseEvent.MOUSE_DOWN, select);

Open in new window


It seems like this should be obvious, but I've tried a number of things to no avail.  Thanks for any help!
0
Comment
Question by:scotru
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 37797255
i think what you need to do is combine everything into a movieclip. just select all and convert to moveclip.
0
 

Author Comment

by:scotru
ID: 37804398
Thanks for your suggestion, but object is already a movie clip.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 37804954
if you still require assistance, will you upload the file. (fla)
0
 

Accepted Solution

by:
scotru earned 0 total points
ID: 37862454
Ok, I was able to resolve this issue by switching to using V2 of Senocular's transform tools.  V1 of the tells appear to act on any sprite on the stage.  When you move the symbol MC onto the stage after importing from AI, they are containers and also contain MC (which inherit from Sprite) for all the layers within the group.  Since the Senocular tools act on all the MC's, they act on the subparts too.  

By switching to version 2 of the scripts, I was able to create a common base class for the symbols (container MCs) that I actually wanted to manipulate and then activate and deactivate the transform tools from the base class.  Thus the transform tools don't get called on all the MCs on the stage, only on the ones that inherit from my base class.

I also ran into a second problem.  That is one of the layers in my AI sprites (a shading layer) was translucent.  This created problems for me when printing as the shading layer did not print as a half-tone and I got a non-translucent shading layer making my printed sprites look funny.  I was able to get around this by using a print as bitmap parameter when printing.

I'd prefer to somehow back the translucency into the sprite, but not sure how to do that without losing image quality (maybe not possible).
0
 

Author Closing Comment

by:scotru
ID: 37879997
Was able to resolve this through experimentation.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't get text from a text entry 13 282
anti-download video publishing site? 6 615
Action Script coding 1 177
Youtube video error 30 775
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question