Link to home
Start Free TrialLog in
Avatar of scotru
scotruFlag for United States of America

asked on

Export from Illustrator to Flash problem with multiple groups and selection

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!
Avatar of blue-genie
blue-genie
Flag of South Africa image

i think what you need to do is combine everything into a movieclip. just select all and convert to moveclip.
Avatar of scotru

ASKER

Thanks for your suggestion, but object is already a movie clip.
if you still require assistance, will you upload the file. (fla)
ASKER CERTIFIED SOLUTION
Avatar of scotru
scotru
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scotru

ASKER

Was able to resolve this through experimentation.