Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Export from Illustrator to Flash problem with multiple groups and selection

Posted on 2012-04-01
5
Medium Priority
?
631 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

721 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