A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: adjust RGB settings for symbols - is it possible?

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    3

    Red face

    Flash Gurus:

    Is it possible to adjust the RGB (color) settings for a movie-clip or button symbol? Everything I've read seems to indicate that setRGB only works for an actual movie clip, not a simple symbol...

    What I'd like to be able to do is have an onclick event that dynamically changes the colors of some symbols. I know the _alpha property seems to work for these symbols, and that gets me close to where I'd like to be, but just not all the way.

    Are there commands or functions that I am missing? Is there another way I could do this without creating multiple symbols for each color I want to have? Any help you may be able to provide is greatly appreciated!

    Thanks,

    Sean

  2. #2
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    just drag a symbol to stage and convert it into movieclip ... i think there is no other thing is there to chang RGB dynamically .... yeah u can chage RGB of it at designing stage ...

  3. #3
    the indian sunmillennium's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi INDIA
    Posts
    249
    in flash MX i think all symbols like buttons and textfields have instance names , cant we use these instance names in setRGB to change RGB at runtime?

  4. #4
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    never tried ... i'll try if i got a time or u also try ..

  5. #5
    Actkid
    Join Date
    Feb 2001
    Location
    Surat
    Posts
    764

    Post hi guys,

    You can always change the color of buttons and dynamic text field at run time.

    i will explain of you about button :

    just make the button and put it on the stage give the instant name "bt" to it now put the following code on the main frame of root where you put the button.

    Code:
    myColor = new Color(_root.bt);
    myColor.setRGB(0xff1933);
    this will definately change the color of button..and about the dynamic text field there are lots of function for the text field.

    textfield.backgroundcolor will change the back ground color of it.


  6. #6
    ?
    Join Date
    Feb 2002
    Location
    sweden
    Posts
    80
    let's see if i remember the code correct...

    when you set the rgb of a symbol it will be easier to use bitshift than writing hex numbers...

    so instead of:
    Code:
    myColor = new Color(_root.bt);
    myColor.setRGB(0xff1933);
    use:
    Code:
    myColor = new Color(_root.bt);
    myColor.setRGB(255<<16||255<<8||255); //this is RGB white...
    .b

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