Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Export from Illustrator to Flash problem with multiple groups and selection

Posted on 2012-04-01
5
Medium Priority
?
635 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

916 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