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

applying styles to library MCs added to the stage

Explorer ,
Apr 12, 2018 Apr 12, 2018

Hi,

I am at really at a loss on this. If I manually place an image component on the stage, I can apply CSS styles to it no problem.

myImage.style.WebkitFilter = "invert(1)";

This works fine!

HOWEVER

if I add the image from the library via script, e.g., stage.addChild(myImage), the style doesn't apply to the same image. Any ideas on how to apply styles to images added to the stage from the library via script? This is driving me absolutely nuts. Thanks in advance.

243
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

LEGEND , Apr 16, 2018 Apr 16, 2018

Components create browser DOM elements floated over the stage. That's why they can take CSS styles. Library items rendered to the the stage canvas element are just pixels on a bitmap. You can't style pixels.

Translate
Adobe Employee ,
Apr 16, 2018 Apr 16, 2018

In the time that an expert gets to your question, can you have a look at the following articles to see if there is anything here that can help?

https://code.tutsplus.com/tutorials/adjust-the-color-properties-of-an-image-using-actionscript-3--ac...

Adobe Flash Professional CS5 * Setting styles

Thanks,

Preran

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
LEGEND ,
Apr 16, 2018 Apr 16, 2018
LATEST

Components create browser DOM elements floated over the stage. That's why they can take CSS styles. Library items rendered to the the stage canvas element are just pixels on a bitmap. You can't style pixels.

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