Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Control Flash stage background colour using External Text File

Posted on 2007-03-24
5
Medium Priority
?
394 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

670 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