View Full Version : Flex Apollo Image Refresh
dbedient
06-01-2007, 03:54 AM
I have a webcam static image that I need to refresh every 5 minutes. I found this thread -
http://www.actionscript.org/forums/showthread.php3?t=135791
I think this is what I need to do but I cannot load the flash.utils
Are they not available to Apollo projects?
Help?
flexy
06-01-2007, 09:10 AM
You should be able to load those classes without any problems; definitely on the Apollo LiveDocs.
http://livedocs.adobe.com/apollo/1.0/aslr/flash/utils/package.html
Can you post your code?
dbedient
06-01-2007, 02:35 PM
I finally got it working this morning. The only thing I can figure is that there may have been some invisible residue from the copy-paste.
Thanks.
dbedient
06-05-2007, 02:03 PM
I have the Timer to trigger the image refresh working but I cannot get the images to swap. My thought was to request the image at the end of the timer, when the new image loaded, swap it out and then fade out the old. I tried to slap a random number on the end of the file because I thought it was caching but I may not be approaching this properly.
public function timerHandler(event:TimerEvent):void {
trace("reset timer" + event);
cacheNum = Math.random();
transImage.addEventListener(Event.COMPLETE,newImag e);
transImage.load("http://wrkstation1.ivgid.org/skibeach.jpg?c=" + cacheNum);
}
private function newImage(event:Event):void {
trace("new image received");
webcam = transImage;
transImage.visible = 0;
}
]]>
</mx:Script>
<mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
<mx:Image hideEffect="{fadeOut}" x="201.5" y="10" id="transImage" width="447" height="337" autoLoad="true" cachePolicy="off" cacheAsBitmap="false"/>
<mx:Image x="201.5" y="10" id="webcam" width="447" height="337" autoLoad="true" cacheAsBitmap="false"/>
Thanks in advance.
dr_zeus
06-05-2007, 06:03 PM
webcam = transImage;
That won't work. I'm not sure its easy to swap the data directly either. For an easy solution, I recommend swapping the image depths.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.