Solved

Control Flash stage background colour using External Text File

Posted on 2007-03-24
5
393 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 18786575
did you try it like this..

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

Z
0
 

Author Comment

by:t_rice
ID: 18786671
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
ID: 18787331
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
ID: 18787994
Perfect, thanks for your help.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 18788250
You're welcome...  :)

CyanBlue
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

622 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