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

  • SEARCH
  • Home
  • 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 1038801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:01:15+00:00 2026-05-16T15:01:15+00:00

I need to use the Button component from the UI Components Panel in the

  • 0

I need to use the Button component from the UI Components Panel in the Flash IDE, with the toggle property set to true.

If I use it with a timeline script it works great.

If I use within a class(a Document Class), the selected property is reversed
(I get true when it’s not toggled and vice versa).

Also if I set toggle to false in the Property Inspector, then set toggle to true in the document class, it still traces out as false. If I invalidate, I toggle traces true, but
the selected property always traces false.

Timeline code is as simple as this:

bold_b.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void {
    trace(event.currentTarget.selected);
}

Document class is simple as well:

package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;

    public class ButtonTester extends MovieClip
    {
        public function ButtonTester()
        {
            //in timeline works fine, in class it's the other way around
            bold_b.addEventListener(MouseEvent.CLICK, onClick);
            bold_b.toggle = true;
            bold_b.invalidate('toggle',true);
            bold_b.drawNow();
            stage.invalidate();
            trace('bold_b.toggle: ' + bold_b.toggle);
            function onClick(event:MouseEvent):void {
                trace(event.currentTarget.selected);
            }
        }

    }
}

Currently I’m using Flash CS3. I’ve got Flash Player 10 installed. Don’t know the components ‘build’ version, but they were written in 2007 under Flash Player 9.0.28.0

Does anyone know how to get around this ?

  • 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-16T15:01:15+00:00Added an answer on May 16, 2026 at 3:01 pm

    and what about this?

    import fl.controls.Button;
    
    var myButton:Button = new Button();
    myButton.toggle = true;    
    myButton.selected = true;
    myButton.label = "selected:" + myButton.selected;
    myButton.width = 120;
    myButton.move(10, 10);
    myButton.addEventListener(Event.CHANGE, changeHandler);
    addChild(myButton);
    
    function changeHandler(event:Event):void {
        var myBtn:Button = event.currentTarget as Button;
        myBtn.label = "selected:" + myBtn.selected;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a custom component that I need to use if I create a
A passionate discussion from today. Developer 1: AJAX is a set of tools, use
I need use this code: <%= button_tag :class => btn btn-primary do %> <%=
I need use this method with three distinct classes: Orders, Customers, Suppliers public void
I have installed Matlab r2010a on my computer I need use the function xlsread
So, I need use this event so I can navigate trought blog posts. I
Need to use own imaged markers instead built-in pins. I have several questions. 1.
I need to use maps on running in a physical Android device, how do
I need to use the objdump and readelf commands in my application that runs
I need to use unix Style line endings (only LF) in Zend Studio 8/9

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.