Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 472387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:04:55+00:00 2026-05-13T00:04:55+00:00

Here is the premise: I have 10 buttons each with on normal state image

  • 0

Here is the premise:

I have 10 buttons each with on normal state image (buttonX.png) and a mouseover state (buttonXglow.png). The buttons are created manually in flash, but referenced in my as3 main class.
I need to add different states to the buttons.

I want do the following:

  1. mark on of the buttons as selected, e.g. show it with the (buttonXglow.png) all the time.
  2. be able to disable the buttons (I’m using mouseEnabled = false; at the moment which turns its behavior off, but I also want to change the appearance to a (buttonXout.png) image).

  3. seems fairly complicated in AS3, I’ve tried to embed the (buttonXglow.png) images with the following which I placed as member variables in my main class, but it doesn’t seem work for me.

    [Embed(source='button1out.png')]
    public static var Button1Out:Class;
    

Also I’m not sure how to actually replace the buttons apperance with the bitmap if I get it to work. I was thinking that I should replace the upState of the button.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:04:55+00:00Added an answer on May 13, 2026 at 12:04 am
    1. Seems fairly complicated in AS3, I’ve tried to embed the
      (buttonXglow.png) images with the
      following which I placed as member
      variables in my main class, but it
      doesn’t seem work for me.

      [Embed(source=’button1out.png’)]
      public static var Button1Out:Class;

    (this doesn’t work in flash cs3)

    Seems like the answer here that the [Embed(…)] syntax above belongs to FlashDeveloper,
    for Flash CS3 which I’m using the option is to manually import the images in to a library
    and set up so a class is created for each image (a bit time consuming but it worked).

    Edit: Note that I had problems with “2022 Class %1 must inherit from DisplayObject to link to a symbol.”. This seems to be a bug in Flash CS3 that for some reason the Linkage stopped working. I solve this by deleting the images from the library and import them again.

    Use the Linkage option in the “Bitmap property” window to set Export for ActionScript.
    Set you class name, the base class will be set to flash.display.BitmapData.

    In your code you can used the class as usual, e.g.:

    var image:Bitmapdata=new Button1outClass(23, 23); // Notice that I had to set the width and height inte the constructor.

    I used the following code to generate a Sprite with the bitmap:

    button1Out=new Sprite();
    button1Out.addChild(new Bitmap(new Button1outClass(23, 23)));   
    

    Which leads us in on

    1. Mark on of the buttons as selected, e.g. show it with the
      (buttonXglow.png) all the time.
    2. Be able to disable the buttons (I’m using mouseEnabled = false; at the
      moment which turns its behavior off,
      but I also want to change the
      appearance to a (buttonXout.png)
      image).
    1. Is easily solved by pointing

      button.upState=button.overState;

    (problem is that I need save the upState so I can restore it)

    1. is as easy as:

      button.upState=button1Out:

    (also here restore is an issue but since I’m only goning to disable buttons never enable them again I’m good to go here)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 263k
  • Answers 263k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I see three basic possibilities: Setup a LocationListener, and then… May 13, 2026 at 12:01 pm
  • Editorial Team
    Editorial Team added an answer The include file <ext/hash_map> refers to the GNU extension hash… May 13, 2026 at 12:01 pm
  • Editorial Team
    Editorial Team added an answer join('', grep { !ref } $para->content_list) May 13, 2026 at 12:01 pm

Related Questions

Here is the premise: I have a desktop that I need to be able
I have some code defined as follows: typedef long (*ShellExecFunct)(long, const char*, const char*,
I had an idea I was mulling over with some colleagues. None of us
This is a long one, The Premise Was called in to help out a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.