Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 6th, 2003, 10:19 AM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Set movie background color with actionscript

How can I change the movie's background color with actionscript?
__________________
http://dhtmlkitchen.com/

Reply With Quote
  #2  
Old May 6th, 2003, 08:24 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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:
function changeBG(col) {
    
_root.createEmptyMovieClip("bgClip"0);
    
bgClip.beginFill (col100);
    
bgClip.lineStyle (1col100);
    
bgClip.moveTo (00);
    
bgClip.lineTo (Stage.width0);
    
bgClip.lineTo (Stage.widthStage.height);
    
bgClip.lineTo (0Stage.height);
    
bgClip.endFill();
}
changeBG(0xCCCCCC); 

Reply With Quote
  #3  
Old May 7th, 2003, 11:09 AM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #4  
Old May 7th, 2003, 11:20 AM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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.
Attached Files
File Type: zip changebg.zip (2.0 KB, 665 views)

Reply With Quote
  #5  
Old May 9th, 2003, 09:57 AM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
This must sound incredibly stupid. I cannot figure out how to name the instance.

Reply With Quote
  #6  
Old May 9th, 2003, 10:17 AM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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.

Reply With Quote
  #7  
Old May 12th, 2003, 11:25 AM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Set movie background color with actionscript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway