Solved

Export from Illustrator to Flash problem with multiple groups and selection

Posted on 2012-04-01
5
610 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Firefox video player - embedded native versus VLC player 3 1,092
Adobe flash player fails to install 12 313
Adobe Flash Player ActionScript error 6 67
Flash ActionScript 6 58
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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

828 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