Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Thread Tools Rate Thread Display Modes
Old 07-05-2006, 03:52 PM   #1
Registered User
Join Date: May 2006
Posts: 4
Angry How to copy the background color between movieclips in a component.

I need to copy the background color from one movieclip to another inside a component I'm building.

The component is a Tab component that allows to select one of several movieclips to display in a data entry application. I mean, once deployed in the Stage you can associate each "ear" of the Tab with a different movieclip (and assign a name to that ear too). For example:

tab[1]: name = "ID"; movie = ID_data.
tab[2]: name = "Job"; movie = Job_data.

When the user clicks on tab[2], for example, I want the background color of this tab to become the same as the background color of the Job_data movieclip.

Here is my current code:

import flash.geom.Transform;
import flash.geom.ColorTransform;
class SysnetTab8 extends MovieClip {

private var __pestanas:Array = new Array(); // stores the tabs objects
private var __peliculas:Array = new Array(); // stores the movieclips

function selectTab (numeroTab:Number) {
__pestanas[numeroTab].gotoAndStop (2);
__pestanas[numeroTab].pestanaActiva.transform.colorTransform = _root[__peliculas[numeroTab]].transform.colorTransform;


Each tab is an instance of a movieclip that has two frames and several layers. In one layer I have a movieclip with name pestanaActiva spread over the two frames. This movieclip is the one I need to change its color.

__pestanas[numeroTab].pestanaActiva correctly points to that movieclip as revealed by traceing it.

I had to use _root[__peliculas[numeroTab]] because I was unable to store this reference in the __peliculas array (I always got an undefined). So the array stores the names of the movieclips and the implicit eval returns the correct reference.

Despite of this, the transform and transform.colorTransform properties always returns undefined.

This is nasty because when I put this code outside the class it functions perfectly!

Can someone help me? I am making some mistake?

Tnanks in advance.
sysnet is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1166 10-29-2013 06:18 PM
Scrollpane component inside a window component marcusg Components 2 04-07-2005 04:20 AM
CyanBlue's 5000th Post - Useful Threads List CyanBlue Projectors and CDs 104 02-25-2005 01:13 PM
Background of textfield linked to textfile turns white when attached with scrollbar trih4rd ActionScript 1.0 (and below) 3 06-29-2004 04:23 AM
Tree Component Styles (2004) zumpner Components 0 09-27-2003 09:43 PM

All times are GMT. The time now is 05:56 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.