Hi,
im trying to make a flash rollover that dynamically inserts an external jpg. here’s what i’ve got so far: http://www.ronniesalvato.com/help
the main problem is that there is no image when it first loads until i actually rollover with my mouse. after that it seems to function properly.
also, is there an easier way to create a rollover like the one i have without using the before and after .jpgs?
heres my code, thanks:
import fl.transitions.;
import fl.transitions.easing.;
var images:Array = [“before.jpg”, “after.jpg”]
// image 1
var image1:Loader = new Loader();
image1.load(new URLRequest(images[0]));
addChild(image1);
// image 2
var image2:Loader = new Loader();
image2.load(new URLRequest(images[1]));
image2.alpha = 0;
addChild(image2);
stage.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
stage.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
function mouseOverHandler(e:MouseEvent):void
{
image1.alpha = 0;
image2.alpha = 1.0;
}
function mouseOutHandler(e:MouseEvent):void
{
image2.alpha = 0;
image1.alpha = 1.0;
var myTween:Tween = new Tween(image2, “alpha”, Strong.easeIn, 1, 0, 5, false);
var imageRequest:URLRequest = new URLRequest(“bird.jpg”);
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
imageLoader.x = 10;
imageLoader.y = 10;
imageLoader.addEventListener(MouseEvent.CLICK, doSomething);
function doSomething(Event:MouseEvent):void
{
var _link:URLRequest = new URLRequest(“http://www.ronniesalvato.com”);
navigateToURL(_link);
}
}