Link to home
Start Free TrialLog in
Avatar of kadin
kadinFlag for United States of America

asked on

When mouse over this, that becomes visible?

What is the best to code this? Do I use view states or event handlers? Can you show me an example? Thanks.
When I mouse over whole group, I want group rect47 to become visible.

<s:Group id="whole group">	
	<s:Group id="rect47">
		<s:Rect>
			<s:fill>
				<s:SolidColor color="0x474747"/>
			</s:fill>
		</s:Rect>
	</s:Group>
			
	<s:Group id="rect87">
		<s:Rect>
			<s:fill>
				<s:SolidColor color="0x878787"/>
			</s:fill>
		</s:Rect>
	</s:Group>
</s:Group>

Open in new window

Avatar of kadin
kadin
Flag of United States of America image

ASKER

Here is what I have so far, but I am getting multiple errors.

1067: Implicit coercion of a value of type String to an unrelated type Number.
1119: Access of possibly undefined property mouseOver through a reference with static type spark.components:Group.



<fx:Script>
  <![CDATA[
    private function showYourSelf():void {
      if (wholeGroup.mouseOver==true) {
        rect47.alpha="1.0";
      } else {rect47.alpha="0.3";}
    }
  ]]>
</fx:Script>

<s:Group id="wholeGroup" mouseOver="showYourSelf()" >
	
  <s:Group id="rect47">
    <s:Rect>
      <s:fill>
        <s:SolidColor color="0x474747"/>
      </s:fill>
    </s:Rect>
  </s:Group>
			
  <s:Group id="rect87">
    <s:Rect>
      <s:fill>
        <s:SolidColor color="0x878787"/>
      </s:fill>
    </s:Rect>
  </s:Group>

</s:Group>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kadin

ASKER

It worked. Thank you. You helped me learn.