Skip to main content
Zeloslaw
Known Participant
January 10, 2013
Question

IconItemRenderer iconDisplay Transition Fade - mobile

  • January 10, 2013
  • 2 replies
  • 523 views

How to make the transition iconDisplay mobile IconItemRender class?
Previously, I did this:


<s:transitions>

        <s:Transition fromState="_edit" toState="_normal" >

            <s:Fade targets="{myIconDisplay}"/>

        </s:Transition>

        <s:Transition fromState="_normal" toState="_edit" >

            <s:Fade targets="{myIconDisplay}"/>

        </s:Transition>

    </s:transitions>

Unfortunately, it is not bindable standard iconDisplay so I can not use it.

Such transitions are not working in AIR:


import fl.transitions.*;

import fl.transitions.easing.*;

var myTM:TransitionManager = new TransitionManager(my_mc);
myTM.startTransition({type:Fade, direction:Transition.OUT, duration:3, easing:Strong.easeOut});

}

Is it better to create everything in AS3, or I can still use mxml? How to create a an efficient list of transitions?
Please help.

This topic has been closed for replies.

2 replies

Zeloslaw
ZeloslawAuthor
Known Participant
January 10, 2013

I have found, but how it connected to a iconDisplay?


import spark.effects.Fade;

... 

private function initializeHandler():void

{

               var hideFade:Fade = new Fade();

                hideFade.alphaFrom = 1.0;

                hideFade.alphaTo = 0.0;

                hideFade.duration = 1000;

                var showFade:Fade = new Fade();

                showFade.alphaFrom = 0.0;

                showFade.alphaTo = 1.0;

                showFade.duration = 1000;

}

Zeloslaw
ZeloslawAuthor
Known Participant
January 16, 2013

I solved the problem. IconDisplay should be placed in a container, such as Group. Then can be controlled effects, such as Fade, Rotate, Resize.

Example my itemRender:

...

override protected function createChildren():void

{

     super.createChildren();

     iconContainer = new Group();

     hideFade = new Fade();

     hideFade.alphaFrom = 1.0;

     hideFade.alphaTo = 0.0;

     hideFade.duration = 250;

     hideFade.target = iconContainer;

     addChild(iconContainer);

}

...

override protected function createIconDisplay():void

{

     super.createIconDisplay();

     iconDisplay.smooth = true;

     iconContainer.addElement(iconDisplay);

     iconDisplay.parentChanged(null);

}

...

override protected function commitProperties():void

{

     if(data.editMode == "true")

     {

          hideFade.play();

     }

}

...