Solved

Export from Illustrator to Flash problem with multiple groups and selection

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now