Solved

Applying color to a nested MC using Actionscript 3

Posted on 2008-09-30
5
548 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

707 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

17 Experts available now in Live!

Get 1:1 Help Now