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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:22:04+00:00 2026-05-24T21:22:04+00:00

I’m new to Flex and am porting a pure Flash/AS3 app to Flex 4.5

  • 0

I’m new to Flex and am porting a pure Flash/AS3 app to Flex 4.5

I’ve created a custom MXML component based on BorderContainer

<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer 
    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="160" height="140" >

    <s:Image id="_avatar" enableLoadingState="true" 
        x="0" y="0" width="160" height="120" />

    <s:Label id="_username" x="0" y="125" 
        fontSize="12" fontWeight="bold" /> 

</s:BorderContainer>

I’m trying to add highlighting/growing effect on mouseOver

and “pressed down” effect on mouseDown to that component:

<fx:Script>
    <![CDATA[
        import flash.filters.*;

        public static const SHADOW:Array = [ new DropShadowFilter(8, 
            80, 0x000000, 0.2, 32, 32, 1, 1, false, false, false) ];
        public static const GLOW:Array = [ new GlowFilter(0xFFFF00, 
            0.5, 36, 36, 1, 1, false, false) ];

        private var _oldScale:Number;

        private function mouseOver(event:MouseEvent):void {
            _oldScale = scaleX;
            filters = GLOW;
        }

        private function mouseDown(event:MouseEvent):void {
            _oldScale = scaleX;
            scaleX *= 0.95;
            scaleY *= 0.95;
            filters = null;
        }

        private function mouseUp(event:MouseEvent):void {
            scaleX = scaleY = _oldScale;
    filters = GLOW;
        }

        private function mouseOut(event:MouseEvent):void {
            scaleX = scaleY = _oldScale;
            filters = SHADOW;
        }

Unfortunately those methods aren’t called at all.

In pure Flash/AS3 app I’d call

        addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
        addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
        addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
        addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
        addEventListener(MouseEvent.CLICK, handleMouseClick);

and it would work well, but here in Flex 4.5 I don’t know how to do this.

Also I’ve noticed that there is a dropShadowVisible=”true” attribute, but not sure if/how it can be used for my purposes.

And I’m not sure if scaling up/down a custom component is allowed in flex or I probably should use “Flex Effects” (but how?) and also set disableLayout=”true”?

  • 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-24T21:22:06+00:00Added an answer on May 24, 2026 at 9:22 pm

    Either of 2 methods below work for me in Flex 4.5:

    <?xml version="1.0" encoding="utf-8"?>
    <s:BorderContainer 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="160" height="140" 
    mouseOut="handleMouseOut(event)"
    mouseDown="handleMouseDown(event)"
    mouseUp="handleMouseUp(event)"
    mouseOver="handleMouseOver(event)"
    creationComplete="init(event)">
    
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
    
            public function init(event:FlexEvent):void {
                    /*
                    addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
                    addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
                    addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
                    addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
                    addEventListener(MouseEvent.CLICK, handleMouseClick);
                    */
             }
    

    Thank you, Mansuro, I couldn’t give you the answer, but I’ve upvoted yoyur comment.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a small JavaScript validation script that validates inputs based on Regex. I
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.