mouseover state flickers

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default mouseover state flickers

    Hi,
    I am using a custom item renderer to show a set of collector cards (normal
    state shows front, rollover shows back)
    The parent component is a Tilelist containing a set of VBoxes
    On the rollover state, the image continuously flickers. How do I keep it from
    flickering?

    Here is the code...

    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
    width="145" height="188"
    horizontalAlign="center" verticalGap="0"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    mouseOver="currentState='rollState'" mouseOut="currentState=''">
    <mx:states>
    <mx:State name="rollState">
    <mx:SetProperty target="{photo}" name="source" value="{data.altsource}"/>
    </mx:State>
    </mx:states>
    <mx:Image id="photo"
    width="120" height="168"
    source="{data.source}" />
    <mx:Label text="{data.character}" fontWeight="bold" fontSize="14"
    color="yellow" width="136"/>
    <mx:Label text="{data.name}" fontStyle="italic" />
    </mx:VBox>

    cmcskevin Guest

  2. Similar Questions and Discussions

    1. ie6 is briefly flashing mouseover state on menu dropdown
      http://www.kirkwicks.com/client/oya/templates/v20/ The dropdown and mouseover menu is working well in all browsers except ie6/PC. You'll notice...
    2. Cursor flickers whle over flash movie
      I have linked to a dlash movie from director. While the flash movie is playing, the cursor flickers. I have tried direct to stage and it does not...
    3. Video flickers in Director when using Flash with it
      I'm a new user when it comes to Director. But I thought using it would give me the best of both worlds if I combined it with Flash 2004 Pro. I...
    4. Alpha-enabled MIAW flickers on opening
      Greetings earthlings- was wondering if any of you fine Cast Members might have a tip fer me. I have a cool little MIAW with an alpha channel that...
    5. direct to stage flickers and flash
      I have some flash movies running in my director project. When I set them to play direct to stage there is a nasty flicker at the start of each...
  3. #2

    Default Re: mouseover state flickers

    Your problem stems from multiple mouseOver events. I've made some
    modifications to your code which seem to work. The states have been removed
    and replaced with actionScript methods which do the following:

    The method for the mouseOver event swaps the image and disables the event to
    prevent flicker. The method for the mouseOut event will restore both the image
    and the mouseOver event.

    The other change is the source of the event. Rather than the box, the photo
    should be the source of the event just in case the photo is not the same
    dimension as the box.

    <mx:Script>
    <![CDATA[
    [Bindable]
    [Embed(source="Rick.jpg")]
    private var p1: Class;

    [Bindable]
    [Embed(source="duck.jpg")]
    private var p2: Class;

    private var toggle : Boolean = false;

    private function rollDuck(event : MouseEvent) : void
    {
    // this event is triggered the first time the mouseOver happens.
    photo.source = p2;
    // now remove event barrage to stop flickr
    photo.removeEventListener(MouseEvent.MOUSE_OVER, rollDuck);
    }

    private function rollBack(event : MouseEvent) : void
    {
    // replace original photo
    photo.source = p1;
    // restore roll over event
    photo.addEventListener(MouseEvent.MOUSE_OVER, rollDuck);
    }
    ]]>
    </mx:Script>
    <mx:VBox id="boxedIn" xmlns:mx="http://www.adobe.com/2006/mxml"
    width="145" height="188"
    horizontalAlign="center" verticalGap="0"
    horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:Image id="photo"
    width="120" height="168"
    source="{p1}" mouseOver="rollDuck(event)" mouseOut="rollBack(event)"/>
    <mx:Label text="Moose" fontWeight="bold" fontSize="14" color="yellow"
    width="136"/>
    <mx:Label text="Yada" fontStyle="italic" />
    </mx:VBox>



    javamonjoe Guest

  4. #3

    Default Re: mouseover state flickers

    It flicks one time....
    When 1 change...
    why?
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139