Solved

Control Flash stage background colour using External Text File

Posted on 2007-03-24
5
381 Views
Last Modified: 2008-01-09
Hi,

We are trying to control Flash stage background colour using External Text File.  Click on botton (see below code) the background colour changes, but we want it to load the colour from the text without clicking any botton.  But it wont work if it's changed from onRelease to onLoad.

url = new LoadVars();
url.load("myPhoto.txt");
url.onLoad = function() {
_root.clipname.loadMovie(url.location);

function nuColor(col) {
meColor=new Color(bground);
meColor.setRGB(col);
}

_root.bt1.onRelease=function(){
    nuColor(url.color1);
}
_root.bt2.onRelease=function(){
    nuColor(url.color2);
}
_root.bt3.onRelease=function(){
    nuColor(url.color3);
}

}

Thanks
0
Comment
Question by:t_rice
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:Zeffer
Comment Utility
did you try it like this..

this.onLoad=function(){
    nuColor(url.color1);
}

Z
0
 

Author Comment

by:t_rice
Comment Utility
Hi,

Thanks for the quick response, we've just tried it and it hasn't worked.  As below:

url = new LoadVars();
url.load("colors.txt");
url.onLoad = function() {
_root.clipname.loadMovie(url.location);

function nuColor(col) {
meColor=new Color(bground);
meColor.setRGB(col);
}

this.onLoad=function(){
    nuColor(url.color1);
}

}

Help :)
0
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
Comment Utility
How about this???

url = new LoadVars();
url.load("colors.txt");
url.onLoad = function()
{
      _root.clipname.loadMovie(url.location);
      nuColor(url.color1);
}

function nuColor(col)
{
      meColor=new Color(bground);
      meColor.setRGB(col);
}

CyanBlue
0
 

Author Comment

by:t_rice
Comment Utility
Perfect, thanks for your help.
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
You're welcome...  :)

CyanBlue
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

743 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

13 Experts available now in Live!

Get 1:1 Help Now