0 Replies Latest reply on Nov 8, 2007 8:13 AM by rkwattsinconnecticut

    Embed seems to conflict with Dissolve

    rkwattsinconnecticut
      This newbie app rotates 4 pics with a timer and slides in a different caption for each. Each pic dissolves into view...except for this. If I Embed the pic (like in 2 of the lines below) the dissolve effect does not seem to work. If I don't embed the pics (like the other 2 lines below) the dissolve works properly. I am missing something simple no doubt. Any help is appreciated.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="480" height="404" verticalScrollPolicy="off" horizontalScrollPolicy="off" creationComplete="init()">
      <mx:states>
      <mx:State name="state2">
      <mx:SetProperty target="{imagebox}" name="source" value="@Embed('Z:/images/DSC02887.JPG')" />
      <mx:SetProperty target="{text1}" name="text" value="Paint Center in Branford"/>
      <mx:SetProperty target="{text1}" name="width" value="224"/>
      <mx:SetProperty target="{canvas02888}" name="width" value="244"/>
      </mx:State>
      <mx:State name="state3">
      <mx:SetProperty target="{imagebox}" name="source" value="../IMG_0293.JPG" />
      <mx:SetProperty target="{text1}" name="text" value="Millwork Showroom in Niantic"/>
      <mx:SetProperty target="{text1}" name="width" value="307"/>
      <mx:SetProperty target="{canvas02888}" name="width" value="317"/>
      </mx:State>
      <mx:State name="state4">
      <mx:SetProperty target="{imagebox}" name="source" value="../IMG_0460.JPG"/>
      <mx:SetProperty target="{text1}" name="text" value="Millwork Showroom in Branford"/>
      <mx:SetProperty target="{text1}" name="width" value="307"/>
      <mx:SetProperty target="{canvas02888}" name="width" value="317"/>
      </mx:State>
      </mx:states>
      <mx:Image x="0" y="0" id="imagebox" scaleContent="true" source="@Embed('Z:/images/DSC02888.JPG')" completeEffect="{myDissolve}"/>
      <mx:Canvas x="10" y="365" width="317" height="29" id="canvas02888" backgroundColor="#C0C0C0" backgroundAlpha=".7">
      <mx:Text x="10" y="1" text="Hardware Showroom in Branford" color="#FFFFFF" fontFamily="Verdana" fontSize="18" fontWeight="normal" width="307" id="text1"/>
      </mx:Canvas>


      <mx:Script>
      <![CDATA[
      private function moveImage1():void {
      myMove1.end();
      myMove1.xTo=100;
      myMove1.xFrom=800;
      myMove1.yTo=380;
      myMove1.yFrom=380;
      myMove1.play();
      }
      private function moveImage2():void {
      myMove2.end();
      myMove2.xTo=120;
      myMove2.xFrom=-800;
      myMove2.yTo=380;
      myMove2.yFrom=380;
      myMove2.play();
      }
      private function moveImage3():void {
      myMove3.end();
      myMove3.xTo=100;
      myMove3.xFrom=-800;
      myMove3.yTo=380;
      myMove3.yFrom=380;
      myMove3.play();
      }
      private function moveImage4():void {
      myMove4.end();
      myMove4.xTo=100;
      myMove4.xFrom=800;
      myMove4.yTo=380;
      myMove4.yFrom=380;
      myMove4.play();
      }


      ]]>
      </mx:Script>
      <mx:Dissolve id="myDissolve" duration="2000"/>

      <mx:Move id="myMove1" target="{canvas02888}"/>
      <mx:Move id="myMove2" target="{canvas02888}"/>
      <mx:Move id="myMove3" target="{canvas02888}"/>
      <mx:Move id="myMove4" target="{canvas02888}"/>
      <mx:Script>
      <![CDATA[

      import flash.utils.Timer;
      import flash.events.TimerEvent;
      import flash.utils.setInterval;

      private var timer:Timer;
      //private var slideshowTimer:Timer;
      //private var controlsTimer:Timer;
      [Bindable] private var $n:int = 100;


      [Bindable] private var currentTime:String;

      private function init():void
      {
      timer = new Timer(4000,$n);
      timer.addEventListener(TimerEvent.TIMER, rotate);
      timer.start();
      moveImage1();
      }


      private function rotate(evt:TimerEvent):void
      {
      if (currentState=='state4')
      currentState='', moveImage1();
      else if (currentState=='state3')
      currentState='state4', moveImage4();
      else if (currentState=='')
      currentState='state2', moveImage2();
      else
      currentState='state3', moveImage3();
      $n = $n - 1;
      }



      ]]>
      </mx:Script>
      <mx:TextArea x="145" y="314" visible="false" id="testtime" text="{$n}"/>

      </mx:Application>