Solved

Applying color to a nested MC using Actionscript 3

Posted on 2008-09-30
5
554 Views
Last Modified: 2013-11-11
Hi Hope you can help...

I'm having trouble creating a custom FLV player using Flash CS3 and its Video components.

Although I have successfully created the player and all of its content (Play/Pause Button and SeakBar) I want to be able to change the colour of the SeekBarHandle using actionscript.

I have managed to change the colour of a test movieclip (in the root of the swf) using the code below however if I try to give the SeekBarHandle an instance of mc Flash asks me to give an instance name to its parent and at this point the FLV player stops working?

I'm new to all this so no doubt overlooking something simple.

Any help would be greatly appreciated.





var color_transf:ColorTransform = mc.transform.colorTransform;

/*color_transf.color = root.loaderInfo.parameters.colour;*/

color_transf.color = 0x00FFFF;

mc.transform.colorTransform = color_transf;

Open in new window

0
Comment
Question by:sany101
  • 3
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 22611488
I request to attach your sample FLA to get the real picture of the nested Movie structure..
0
 

Author Comment

by:sany101
ID: 22612309
Hi anneeshchopra thanks for the quick response and appologies, I couldn't work out how to attache the fla as EE would accept it.

Anyway here is a direct download link to it.

www.sany101.pwp.blueyonder.co.uk/flash.zip

Thanks again
0
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 22613271
ok,
I reviewed it and seems like you want to set the color for "SeekBarHandle" movieClip.

as I see that you have given instance name as "mc" on second frame,

for your info, this instance never come into picture, FLV component actually create an instance dynamically using library linkage ID, and another point is "instance name" also comes dynamically, means no fix instance name..


so I suggest that you should go inside the "SeekBarHandle" movieClip and just add "color change" code on its first frame..

as following:

var color_transf:ColorTransform = this.transform.colorTransform;
color_transf.color = 0x00FFFF;
this.transform.colorTransform = color_transf;
0
 

Author Comment

by:sany101
ID: 22613314
Awesome! Thank you so much!
0
 

Author Closing Comment

by:sany101
ID: 31501708
Thanks again
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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 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 the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

929 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

19 Experts available now in Live!

Get 1:1 Help Now