|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Set movie background color with actionscript
How can I change the movie's background color with actionscript?
__________________
http://dhtmlkitchen.com/ |
|
#2
|
|||
|
|||
|
Not directly, but in Flash MX you could use the drawing methods, to draw a colored rectangle to the dimensions of the movie.
PHP Code:
|
|
#3
|
|||
|
|||
|
Thanks, that is a good function that got me pretty close.
The problem is the bgClip is overlapping the other frames in z-index. Can I put the bgClip below the other frames? I checked the reference material on createEmptyMovieClip and it looks like the second parameter should be 0. I tried putting the bgClip on another layer and putting that layer at the bottom but it didn't work. I also had to set the dimensions with hard-coded numbers because Stage.width and Stage.height didn't give me the dimensions of the movie. Code:
bgClip.lineTo (125, 0);
bgClip.lineTo (125, 125);
bgClip.lineTo (0, 125);
Well, you can tell I've only been doing flash for a few days! Do you recommend any actionscript/flash books? I'm looking for a book that doesn't cover programming basics like loops, conditionals, et c, but rather one that explains how to do simple stuff in flash with simple examples. |
|
#4
|
|||
|
|||
|
Okay so the other otpion is to make a new movie clip with a 1 x 1 black square in it and call it lets say bgClip. Put an instance of it on the stage at pos 0,0 and give it an instance name of bgClip. Put it in the bottom layer. Then you can adjust the width and height of it and change the color all with actionscript.
See my attached file. |
|
#5
|
|||
|
|||
|
This must sound incredibly stupid. I cannot figure out how to name the instance.
|
|
#6
|
|||
|
|||
|
Drag the movie clip to the stage, and open the properties panel. Select the clip on the stage. In the properties panel on the right side below the drop down that says Movie CLip, there is an input box, thats where the instance name goes.
|
|
#7
|
|||
|
|||
|
freddydoesphp -
That worked perfectly, thanks. I thought that text field was disabled because it had grey text in it. Since I didn't know what it was for, I just ignored it for a disabled text field. I'm going to use this to: 1) grab a <param> 2) set the bgClip to the value of the param The param is generated dynamically. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Set movie background color with actionscript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|