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 8649041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:27:41+00:00 2026-06-12T13:27:41+00:00

Quite wierd bug i am experiencing with Flex 4.6, with a very simple piece

  • 0

Quite wierd bug i am experiencing with Flex 4.6, with a very simple piece of code.

for ( var j=0 ; j< chip_num; j++)
{

isoChip = new IsoChip();

//isoChip.type=(IsoChip.YELLOW_CHIP); //<<<<<<<<<DOESNOT WORK HERE
isoChip.scaleX = isoChip.scaleY=1//0.45 ; 
isoChip.x= i + 10 * i + 5 ;

isoChip.y= y_num;

addElement(isoChip);


isoChip.type=(IsoChip.YELLOW_CHIP);  //<<<<<<<<<<<<<<WORKS HERE ONLY

y_num = y_num - 2.5 //IsoChip.height ; 

}

Having this component : IsoChip.mxml component

    <?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" width="23" height="20" initialize="init()">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[

            public static const BLUE_CHIP:String = "blueChip" ;
            public static const BLACK_CHIP:String = "blackChip" ;
            public static const YELLOW_CHIP:String = "yellowChip" ;

            public function init(type_val_str="blueChip") 
            {
                blueChip.visible= false; 
                blackChip.visible =false ;
                yellowChip.visible = false ;

                //type = type_val_str  ;


            }

            function set type(type_val_str:String)
            {

                switch( type_val_str)
                {
                    case  IsoChip.BLUE_CHIP:
                        trace(">",IsoChip.BLUE_CHIP)
                        blueChip.visible = true; 
                        blackChip.visible = false ; 
                        yellowChip.visible = false ; 

                    break; 

                    case  IsoChip.BLACK_CHIP:

                        trace(">",IsoChip.BLACK_CHIP)

                        blueChip.visible = false ; 
                        blackChip.visible = true ; 
                        yellowChip.visible = false ;


                    break;

                    case  IsoChip.YELLOW_CHIP:

                        trace(">",IsoChip.YELLOW_CHIP)
                        blueChip.visible = false; 
                        blackChip.visible = false ; 
                        yellowChip.visible = true; 

                    break; 


                }

            }



        ]]>
    </fx:Script>



    <s:SWFLoader id="blueChip" x="0" y="0"  width="23" height="20" source="../swf/blue-iso-chip.swf"/>
    <s:SWFLoader id="yellowChip" x="-16" y="5"  width="23" height="20" source="../swf/yellow-iso-chip.swf"/>
    <s:SWFLoader id="blackChip" x="4" y="9" width="23" height="20" source="../swf/black-iso-chip.swf"/>
</s:Group>

Is it really a bug. Or am i doing something wrong ??

  • 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-06-12T13:27:42+00:00Added an answer on June 12, 2026 at 1:27 pm

    I suggest using states here instead of visibility.

    So, declare 3 states in your group:

    <s:states>
        <s:State name="blue" />
        <s:State name="black" />
        <s:State name="yellow" />
    </s:states>
    

    Then apply each state for each SWFLoader:

    <s:SWFLoader id="blueChip" includeIn="blue" ... />
    <s:SWFLoader id="blackChip" includeIn="black" ... />
    <s:SWFLoader id="yellowChip" includeIn="yellow" ... />
    

    And at last, in the ActionScript code change the state based on the condition:

    switch( type_val_str) {
        case  IsoChip.BLUE_CHIP:
            currentState = "blue";
        break; 
    
        case  IsoChip.BLACK_CHIP:
            currentState = "black";
        break;
    
        case  IsoChip.YELLOW_CHIP:
            currentState = "yellow";
        break; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new in shell scripting, and I encountered a problem that is quite
Quite often, I find myself wanting a simple, dump object in Python which behaves
Quite new to maven here so let me explain first what I am trying
I've created the following simple msbuild project file, but the output is quite weird
psyco seems to be quite helpful in optimizing Python code, and it does it
So I'm not quite sure what to do here. I've got a simple application
I am experiencing something weird that I dont quite understand. I am getting errors
A few minutes ago i stumbled upon quite a very weird phenomenon. It seems
I am quite new to the iphone development and I'm encountering a weird crash
I have an app which im developing for quite some time. I am experiencing

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.