Jump to content


Change Background Text Color Based On Scene Playing


7 replies to this topic

#1 ABClarke

    New Member

  • New Members
  • Pip
  • 4 posts

Posted 17 October 2011 - 09:32 AM

Attached is a simple movie with black text numbers 1, 2 and 3 on the background. Each number has a "on rollover ... play scene (1,2 or 3)" script.

The three scenes are images that fadein hold for a few seconds then loop (continuously) to the next scene/image.

What is the script (or whatever) that will change the background text number from black to red when the associated scene is playing?

Many thanks!

Attached Files



#2 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23919 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 17 October 2011 - 01:14 PM

Attached File  Black to Red Numbers-2.swf   299.27K   15 downloads
Attached File  Black to Red Numbers-2.swi   1.36MB   18 downloads

...also notice I reduced the quality setting for your images to 80%, that's more than efficient and you save yourself over one mb on loading time.

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#3 ABClarke

    New Member

  • New Members
  • Pip
  • 4 posts

Posted 18 October 2011 - 07:37 AM

Many thanks Wolf for the prompt reply. (Thanks also for the suggestion about reducing the quality setting for the images.)

I've "been there, done that" with the numbers in every scene. My approach is to have black numbers on the background scene then the red number in the image scene. But that gets ackward when the scenes are reordered.

So I wondered if the scene playing can control the color of the number on the background scene. (This started when I learned that a Move can change a text's color.)

Thanks again, I look forward to your reply.

#4 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23919 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 18 October 2011 - 09:17 AM

>>This started when I learned that a Move can change a text's color. - but you are not applying the move effect to those numbers.

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#5 ABClarke

    New Member

  • New Members
  • Pip
  • 4 posts

Posted 18 October 2011 - 12:55 PM

Mr. Gross, I appreciate your prompt replies.

Of course there is no Move in my movie! I mentioned it because I recently learned that text colors can be changed in ways I hadn't thought about.

I'm back to my original question -- Are there scripts / commands / whatevers that will change the text on the background scene from black to red based on the associated scene that is playing?

Thanks again and "Hooroo!"
ABC

#6 Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 23919 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 18 October 2011 - 01:32 PM

...why can you not use the changing text in each scene? They might be a way by very complex script to do this but I can't see the reason why you have to do this.

wolf
Posted Image
Web Wolf Wonder Web Works

SWiSHsites modified

#7 ABClarke

    New Member

  • New Members
  • Pip
  • 4 posts

Posted 19 October 2011 - 01:13 AM

Thanks again. The first half of your last sentence ("There might be a way by very complex script to do this...") answered my question. I'll work with red numbers in the individual scenes. ABC

#8 thbiro

    Member

  • Members
  • PipPip
  • 25 posts
  • Location:Paris
  • Interests:my kids, my wife, guitars, music, computers

Posted 30 August 2012 - 07:53 AM

It's quite simple to do, sorry to come so late, I suppose you found out how to do this since last year. But in case you did not you just have to define a new color object for each text :
so on the Background scene you add this :

onSelfEvent (load) {
_root.color1 = new Color(_1_txt);
_root.color2 = new Color(_2_txt);
_root.color3 = new Color(_3_txt);
}

then on scene 1 you add

onFrame(1){
_root.color1.setRGB(0xFF0000); which sets the color of _1_txt to red
_root.color2.setRGB(0x000000); which sets the colors of the 2 others to black
_root.color3.setRGB(0x000000);
}

and do the same on scene 2 and 3

Hope it helps,

Attached File  Black to Red Numbers.swi   1.36MB   9 downloads





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users