Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

changing the screen background color

Enthusiast ,
Jun 04, 2008 Jun 04, 2008
i am new in flash.
now i have a task where i have a site of different items, made in flash but using all the as3 classes.
for the item details page, a class ItemScreen is created which extends Screen.
now my task is to change the background of the details page dynamically based upon the item chosen.

pls somebody help me.
TOPICS
ActionScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jun 08, 2008 Jun 08, 2008
i solved it.
i just used the opaqueBackground property.
Translate
LEGEND ,
Jun 05, 2008 Jun 05, 2008
There are several ways to go about it depending on your code and preferences.

Assuming you have a background in the Screen already (Sprite or MovieClip or other Display Object):

1. You might want to change its color using ColorTransform class.

2. You can replace existing background with a new one (say, Sprite) and draw a rectangle of a desired fill color inside it using yourSprite .graphics class. In this case place a new background into the same stack order as your previous one - old one will be automatically replaced. Don't forget to mark the previous one for garbage collection.

3. You can draw a new rectangle inside the existing background, again, using drawing API (graphics class). Don't forget to invoke clear() method to delete previously drawn rectangle before you draw a new one.

Hope it helps.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 05, 2008 Jun 05, 2008
or you use the color-matrix-filter.

http://www.adobe.com/devnet/flash/articles/matrix_transformations_04.html

with this you are able to change the color of pictures etc.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 08, 2008 Jun 08, 2008
LATEST
i solved it.
i just used the opaqueBackground property.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines