dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: fading the backgound colour using actionscript

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Location
    in the back room of a dark pub
    Posts
    454

    Post

    I am trying to change the background colour using actionscript. So far i have magnaged to tint everything on the root timeline but not the actual background colour. The script i am using is as follows, any help would be much appriciated....

    [code]

    //Create a color object called myColor for the target root
    myColor = new Color(_root);
    //Create a color transform object called myColorTransfrom using
    //the generic Object object
    myColorTransform = new Object;
    // Set the values for myColorTransform
    myColorTransform = new Object();
    myColorTransform.ra = 100;
    myColorTransform.rb = 255;
    myColorTransform.ga = 100;
    myColorTransform.gb = 255;
    myColorTransform.ba = 100;
    myColorTransform.bb = 255;
    myColorTransform.aa = 100;
    myColorTransform.ab = 255;
    //Associate the color transform object with the Color object created for myMovie
    myColor.setTransform(myColorTransform);
    stop();

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Location
    in the back room of a dark pub
    Posts
    454
    tee pee for my bumhole......!!


    help please?

  3. #3
    curmudgeon swampy's Avatar
    Join Date
    Jan 2001
    Location
    [wakey]
    Posts
    2,775
    you can't change the background colour with action script.

    why not have an mc cover the stage area and affect it's colour with the rest of the objects on the stage ?

  4. #4
    Senior Member
    Join Date
    Jun 2001
    Location
    in the back room of a dark pub
    Posts
    454

    because....

    i'm exporting to a projector file and thus if i just make a mc to cover the stage then i still get the stage colour around the mc. This is a bit stupid because you can change the colour of the background colour of the movie through html control so there must be a way to change the background colour.

  5. #5
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Hi,
    I've never tried that but it could be interesting to see if you can acheive that with javascript. As you said the BG is in the embed object. So you need to change it there. I can only give you a link about communication between Flash and html:
    http://www.macromedia.com/support/fl...cript_comm.htm
    gparis

  6. #6
    Member
    Join Date
    May 2000
    Location
    germany
    Posts
    55
    can a projector communicate with javascript???

    try another solution:

    create a MC bigger than your stage...


  7. #7
    Senior Member
    Join Date
    Jun 2001
    Location
    in the back room of a dark pub
    Posts
    454

    thanks but...

    i'm using a projector file


    i'm exporting to a projector file
    so therefore the html business wouldn't work, and deeno although your suggestion is good i would prefer to use a more efficient solution, especially as i am trying to excell in my flash usage especially with mx nearing the corner.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center