Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Dcoo

update an image loader part 2

Recommended Posts

In my last post on this subject, everything was going swimmingly with the "myImage.load(true);" being introduced to the scenario, when the user gets to the "take a picture" part of the app it works perfectly, they can retake the picture over and over and it loads the new image right away using  " Object(root).faceW.myImage.load(true); " from my Camara MC. now my new problem is if they (the user)want to go back and retake the picture after clicking finished(the app at this point has moved the play head to the next frame), the retake button takes back to the frame with the Camara loader but the image is no longer updated after taking any new pictures, only f you quit and restart does the new image load.

 

any ideas on whats happening ? :) 
 

import com.greensock.*;import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;


import flash.filesystem.*;
LoaderMax.activate([ImageLoader]);


var file:String = "IMG_happy.jpg";
var mypic:File = File.applicationStorageDirectory.resolvePath("Photos/"+file);

var myImage:ImageLoader = new ImageLoader(mypic.url,{container:this,x:0,y:0,width:414,height:309,onComplete:onImageLoad});

myImage.load(true);

function onImageLoad(event:LoaderEvent):void {
  TweenLite.from(event.target.content, 1, {alpha:0});
 }
Link to comment
Share on other sites

Really tough to say. My guess would be that when you are moving the playhead around you are re-executing code, losing references to objects that exist on stage or any number of things that could happen. For most AS3 projects I would recommend the single-frame approach to avoid such errors. Its much better to show / hide assets on stage than to jump around timelines. Just my 2 cents.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×