Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Fading Images With Tween



hello all,

the purpose of this file is to open the xml file, and fade between the images. currently, it will not fade the images. i need some help making it work.


ActionScript Code:
var currentImage:int;currentImage = 0;var xml:XML;var xmlList:XMLList;var xmlLoader:URLLoader = new URLLoader();var myLoader:Loader = new Loader();var myTimer:Timer = new Timer(2000,0);xmlLoader.load(new URLRequest("file.xml"));xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);myTimer.addEventListener(TimerEvent.TIMER, switchImage);function switchImage(event:TimerEvent):void{  if(currentImage == xmlList.length() + 1){currentImage = 0;myLoader.load(new URLRequest(xmlList[currentImage].attribute("source")));}else {  currentImage++;  myLoader.load(new URLRequest(xmlList[currentImage].attribute("source")));}}function xmlLoaded(event:Event):void{myTimer.start();    xml = XML(event.target.data);    xmlList = xml.children();    myLoader.load(new URLRequest(xmlList[currentImage].attribute("source")));}
thanks!



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-27-2008, 02:51 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Fading Multiple Images Via Alpha And Tween
hi, im trying to fade two separate images on the same layer from 0 alpha to 100 alpha but flash MX 2k4 will not do it! It works fine if i do the same process with just one image, but not with any more on the same layer.

do i have to do a separate layer for every image i want to fade? Whats the solution to this problem? I have tried grouping them and this does not work either.

I am using the pictures as graphic symbols, and as i say if its just one image that i change the alpha on per layer it works fine (i.e 5 images on one layer, as long as i only tween the alpha on one it works fine, if i try and tween the alpha on any more, grouped or ungrouped it does not work, it just stays at 0 alpha over the tween and even into the next keyframe)

thanks guys!

Fading Out, And Shape Tween
Hey Can someone tell me how to make my movie fade out at the end??

and i also need someone to tell me how to get to the shape tween thing in MX.

I am using MX for both.
-Thanks

Tween Fading Issues
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.display.*;



function nxtFrame ()
{
var txtTween = new Tween(infoMC, "_alpha", tweenStyle, 100, 0, 10);
txtTween.onMotionFinished = function (){

infoMC.infoMask.gotoAndStop (1);
infoMC.nextFrame ();
new Tween(infoMC, "_alpha", tweenStyle, 0, 100, 10);
infoMC.infoMask.play ();
}
}
Hiya

Basically I have a movie clip that when I click 'next', it fades out the current text, moves on a frame in infoMC and then fades back up.

When I trace, everything is working ok, up until the fadeup/mask play, and i've absolutely no idea why this is? Is there anything wrong with the above code?

3 Images… Fading Effect Between The Images
I am very new to flash and I was looking to do a basic flash movie. Here is what I am looking to do. I have 3 images and I would like to create a flash movie that displays the first image and then fades. Then the 2nd image fades in and then the 2nd image fades out. Then the 3rd image fades in and then fades out. Basically it will just display 3 different images, one at a time with a fade in and out effect. I did a Google search looking for a tutorial to help me through this but was not able to find one. Can any one point me to a tutorial that does this very basic effect (even though I say this after playing around for over 2 hours now and I have nothing working).

Is Actionscript Tween Fading Smoother Than Tweening In The Timeline?
I am working on a site that is using alot of fading. Is it smoother to fade a photo using actionscript or does it really make no difference?

Tween Class Alpha Fading Problem, Image Flashes
I have spent ages trying to solve this and it is driving me bananas. I can't find any solutions to this so please can someone help me.

Ok all i am trying to do is fade an external swf in and out. I am using the tween class to do this. My problem is that when my external swf loads in it flashes - its as if the alpha is flashing upto 100 then back down to 0 to start the tween. You can see what I mean on this link if you click on the photogallery button.

http://www.rachael-roberts.co.uk/tween/main.swf

Ok here is the code...


Code:
var tween_handler:Object = new Tween(loader, "_alpha", Strong.easeOut, 100, 0, 1, true);
tween_handler.onMotionFinished = function() {
//loader._alpha=0;
mcl.loadClip(loadThis, loader);
trace("onMotionFinished triggered");
};

preload.onLoadInit = function(targetMC) {
startAlpha = loader._alpha;
var tween_handlerUnhide:Object = new Tween(loader, "_alpha", Regular.easeIn, startAlpha, 100, 1, true);
};
Any ideas? It may be something to do with the loaded photogallery swf. The tabs tween out but just on the timeline that part isn't scripted.

Thanks

Tween Class Fading Loop, Acting Up With Multiple Clicks
Hello all,
I have a thumbnail gallery that I am working on. The gallery works fine and when you click the thumbnails it loads the respective swf into the container.picture movieclip.

I have used the tween class to fade a set of clips in a single swf in a loop infinitely.

The problem lies in that when you click the thumbnail, the swf loads fine and everything plays great (THE FIRST TIME) then if you repeatedly click the same thumbnail the tween class acts up and the fading gets strange, the timing messed up and it starts to almost layer the clicks on each other.

The problem seems VERY similar to when you use a setInterval and don't clear the interval and it starts to overlay them upon multiple clicks.

Is there a way to clear the tween class, delete it at run time, etc? This problem is driving me up the wall.

I have provided my code below (just for the tween class, not for the navigation) to hopefully spark an idea.


Thanks!
Neil











Attach Code

import mx.transitions.Tween;
import mx.transitions.easing.*;

//array that pulls in all movieclips and turns to array
var mcArray:Array = new Array(content1, content2);
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}

var n:Number = 0;

function playFades() {
if (n<mcArray.length) {

var tween_handler1:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 0, 100, 1, true);
tween_handler1.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
//n++;

var tween_handler2:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 100, 0, 3.5, true);
tween_handler2.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
n++;
playFades();
};
};
} else {
n = 0;
playFades();
}
}
playFades();

























Edited: 02/19/2007 at 10:46:10 AM by Visionology

Fading Images
heres the deal:

i have two different backgrounds
and i want to create a button that will fade the background image into the other one.

how would i do this?

thanks.
Greg

Fading Images In And Out?
does anyone know how I can fade images in and out using actionscript?

Fading Images
I need help :P

Im a flash newb and I need to fade the same greyscale image to a full colour image ?

Fading Images
is there any way to do this? all i want is to fade three black squares into view. is this possible as you can't do the normal text effects.

Fading Images Using AS?
Hi,

I'm designing myself a new portfolio site for university, and need to proucuce a transition that fades one page out and then the next page in. Is there any Actionscript I can use to do this?

Any simple examples much appreciated!

Cheers, Skratch

Fading Images Using AS?
Hi,this is probably gonna seem really simple to most of you...

I'm designing myself a new portfolio site for university, and need to proucuce a transition that fades one page out and then the next page in. Is there any Actionscript I can use to do this?

Any simple examples much appreciated!

Also, in Dreamweaver, I've previously used the 'open new browser window' behaviour from a link to display my Flash movies, and entered the .SWF filename as the URL to launch. Can I do a similar thing with Flash's 'get URL' command, or does that only go to HTML/HTM files?

Cheers, Skratch

Fading Two Images In And Out
hi..

I have a photo that is one shade and I would like to use it as the background for the stage. I would like to make the photo fade into a different shade. Im just wondering if this is possible in flash and if so how ? im obviously a begineer.. thanks for the help in advance ..


ie ... (see attachments) splash.jpg has a green tone.. i have another photo of the same thing .. but its in a yellow tone.

Fading Images In
Im trying to make a picture fade in from black , does anyone have code or tutorials on how I can do this? thank

Fading Images
Hi im currently making a project where i take random images from a folder and display them, i am running my script through a *.as text file. I now have to make some kind of transition between one image and the next, does anyone know how i can get one image to fade out and the next to in, using actionscript, time not frames as it were,
thanks, i know its quite easy but i cant work out how to get the gradual fade,
cheers
Lee

Fading Images
How would I make an image fade in and out in MX 2004?

Fading Images - Please Help
Hi, I wasn't sure which forum this should go under so please delete which ever one is in the wrong spot. Here is my dilemma:

i have 20 images..what I am trying to do is this: after 5 sec image 1 fades out so that #2 appears, then after 5 sec image 2 fades out to show #3, and so on and so on. After image 20 it would fade out to #1 and the process would start all over again. However, I can't do this and I'm thinking it's probably an easy thing to do. If anyone could give me a step by step process (because I'm new to Flash) I would be very greatful!!

Thanks

Fading Images
Hi all, I'm new to this whole flash thing and i have a few questions.

1. I want to use cut-outs that i extracted from images in photoshop. I plan to use them as part of my web page layout in a slide show where the pictures fades into another. you can see what i'm talking about here---> www.showtimemag.com
So, how would i go about doing this?

2. How would i be able to get the images to be transparent and show the background of the web site?

Fading 80 Images
I have an animation that will include a part where 80 head shots are flipped through quickly. It's going to be enough work just importing 80 head shots into 80 frames of the movie, but, on top of it, they are requesting that instead of flipping between them that we fade between each one. Obviously, creating 160 tweens is a bit tedious. I was wondering if there was an actionscript solution to this.

Fading Images Into Each Other
I want to use four images to fade into each other like this http://www2.fultonschools.org/school/banneker/

Can someone please explain in detail on how to do this. Also, would it be wise to use a pre-loader for that?

Thanx

Fading Images
is it possible to fade in and out jpg images that are loaded into empty MC's via xml?

Images Fading In And Out
Im trying to write code so that when you roll over a button an image will fade in and when you roll out it fades out... and ive done this successfully....however... every time i roll over the fading in/out is faster and faster.... still a smooth transition oddly enough....

setInterval(function,interval)

that interval is in milliseconds right? or maybe im way off base...

any clue as to why this would be happening....

Please Help Me - Fading Images
I just want to do something very simple... I want to fade in between a series of 640 x 272 photographs- 12 photos over the course of a minute or so... How do I go about doing this? I'm a newbie, a total newbie, can you please explain this to me? How would I fade between these photographs and then get them to loop? Please help me, I've got myself in hotwater with a client and need to get this aspect of the site up and running!!

Fading Images
I am trying to get images to fade in and out on a timer, how do i go about doing this?

Fading In And Out Images
Hi
I hoping someone can help me with this. What I trying to do is create a flash piece with several images. There will be one image on each “page” that will fade in when the corresponding button is clicked. Where I am running into problems is that I want the image on the current image to fade out before the next image fades in.

Many Thanks, Manicjester

XML Images Fading
Hello,

Can anyone please explain or point me in the right direction as to how I can go about loading an XML file containing image paths into a flash movie, and have the images fade into each other and loop forever? ....I'm also looking to have the images start at a random point in the loop each time, so the same image isn't the first one that shows every time...


Thanks!

Fading In Images One After Another
hello,

i'd appreciate if someone can help me with this. i'm having difficulties fading in some images one after another. i have an array containing urls to the images, and i have to fade every next image in (when the user clicks a button), on top of the other (it needs to be a smooth fading between images, no white/black/colored space in between).

this is what i tried, everything's working good but the fading between images isn't the way it should be (the tween fading also doesn't work properly, some images don't end at alpha = 1 they just stay transparent):

code edit because i changed it as it was quite wrong.


Quote:




private function drawBgImage(currentItem:uint, arrayImagini:Array):void
{
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest(arrayImagini[currentItem]);
this.loaderSprite = new Sprite();

loader.addEventListener(MouseEvent.CLICK, onImageClick);
loader.load(request);

this.loaderSprite.addChild(loader);
this.loaderSprite.buttonMode = true;

var myTween:Tween = new Tween(this.loaderSprite, "alpha", None.easeIn, 0, 1, 1, true);
addChildAt(this.loaderSprite, 0);
}




and then i call the function like this:

Quote:




this.loaderSprite.removeChildAt(0);
this.drawBgImage(this.currentItem, this.arrayImagini);




i hope someone can help me. thanks ^^

Fading Between Images
Hi Im currently working on a project and need to create images which fade into the next image when rolling over the appropriate button. I have a strip of 12 thumnail images which onrollover need to show the bigger image in the centre of screen and when moving on to the next thumbnail fade the last bigger image into the next. hope this makes sense. if anyone knows of a tutorial which can help me I would be very gratefull. Thanks

Fading Images
Hi,

I have several buttons in a project, which are suposed to make appear different images in a container. For example, in the button 1 I have the code:


ActionScript Code:
on (release){
loadMovie("pic_001.jpg", _root.photo);
}

Ok. But I want to make the image fade in when it shows up and fade out when unloads and is replaced. Is there an easy way of doing this?

Kind regards,

Kepler

Fading In 3 Images =(
I have an idea, but I am totally unsure how to pull it off.

I have 2 images, and I want to fade them in one overtop of another in a cool way. I was kind of thinking like a flash effect and it fades in, and in a second another one does the same overtop of it. I want to do this for 2 images and I guess make it into a movie clip and loop it.

And for my second question, how do I loop a movie clip along my timeline?

Any help/fla files would be GREATLY appreciated.

Thanks a million

Fading Images In And Out?
Is there a tutorial for how to fade in and out some images?

Fading Images
[size=1]
i [size=3]
i want to publish a movie using images.
i want that images change one by one.i mean one image
fades away after few seconds leading to another image.
any bond personality reading

PLEASE Help-Fading Images In & Out
I know this is really simple..but I completely forget how to do this & when I tried playing around w/ it, it didn't work. I need to figure out how to make images fade in & then fade out in flash mx...any help would be appriciated! thanks so much!
Love Always,
Missy

Fading Images With Xml
While ago someone posted a link for fading image with all the codes/files and everything in response to my post. Since then I have taken this code, swithced the links to my jpgs and it works fine on my computer. But when I upload it, it just doesn't work And I am about to go crazy trying to figure out why. Please help!

So this is the link where I took the code and evertyhing from
http://whatdoiknow.org/archives/001629.shtml

This is where I am uploading stuff
http://amor.outrolugar.com/index2.html

Fading Images
Hi,

i'd like to make a loop of 3 images that fade in one after another with some time between the fades, i'd like to do it in code.

any1 got an idea how to do it.

thanx in advance

Fading Images
How can you fade an image in form left to right? I've seen it done on a few sites and I can't figure it out. If anyone knows can you please post it here.
thanks

Fading Images...
Hello
I wanna to do something that:
I have one image, second one is on it and it's cutted for small parts. How to make it fading? You know, when I hover mouse on it, it disapper slowely and the first image appear. Each part I wanne to make this way. I tried to make it with Transform effect but when I take the cursor from the part it appear again. Could You help me?

Thx in advance

Fading In 3 Images =(
I have an idea, but I am totally unsure how to pull it off.

I have 2 images, and I want to fade them in one overtop of another in a cool way. I was kind of thinking like a flash effect and it fades in, and in a second another one does the same overtop of it. I want to do this for 2 images and I guess make it into a movie clip and loop it.

And for my second question, how do I loop a movie clip along my timeline?

Any help/fla files would be GREATLY appreciated.

Thanks a million

Fading Images In And Out?
Is there a tutorial for how to fade in and out some images?

Fading Images
[size=1]
i [size=3]
i want to publish a movie using images.
i want that images change one by one.i mean one image
fades away after few seconds leading to another image.
any bond personality reading

Fading Images In And Out
Hello!

I have a simple Flash animation - fading in and out different images. I have done it with an Actionscript (changing alpha value). That worked ok only on new processors - on all others it eats 100% CPU. I then tried to do it with timeline (motion tween between 2 alpha values of picture). Now it is considerably better, but on CPUs lower than 2 GHz it still eats 100% CPU. Size of animation is 940x160. How can I do this fading correctly so that CPU will not have to do so much calculations?? Please help me!

Images Fading In.
I'm trying to use AS to fade in images on when the player gets to the frame they are on. Basically like a slide show were when the playhead move to the next frame that image fades in. With a little help from a friend this is the code we got to work:
Code:

onClipEvent(enterFrame){
fadeIn = function(){
   if(_root.lynch._alpha < 100){
      _root.lynch._alpha += 7; //This sets the speed of the fade in 3 is kind of slow higher numbers will speed it up.
   }else{
      _root.lynch._alpha = 100;
   }
   
}
_root.lynch.onEnterFrame = fadeIn();
}


That works fine when I preview the movie...but this movie is getting loaded into another movie and when that happens the fading doesn't work and no images show up. I figured out that the _root. line was causing the problem, but when I remove that from the code above then the fading doesn't work at all. What am I missing?

Fading Flash Images?
What's good peops? I'm currently in the process of designing my web site and needed to know exactly how does one make the image fades that I see in so many INTRO's on sites. If anyone can assist me wit' this info on how I do fades in technical detail, step by step. I'd appreciate it. Thank, Shaiquann

Problems With Fading Big Images
hello, i was wondering when i fade 2 or more pictures into eachother (with alpha) with actionscript if it would use less cpu capacity than just an ordinairy tween. I have the problem that some of my normal tweens really affect the performance of the whole website when tweening. I have seen other sites with even bigger and higher quality photo's that didn't slow down anything on the site. Could someone please explain me if it's possible and how to achieve that.

(the main problem is that normal mouseovers in html that are in the same document respond later due to the cpu usage when tweening. and on the other side, when going over the mouseovers in html it affects the speed of the tween in the swf)

kind regards,

M.Braun

Fading-in A Set Of Images From Outside Of Flashmx
Can anyone help me?

I'd like to fade-in a set of images, (1-4) from a folder outside of a flash movie, ie. externally on the server.

Have a look at http://www.winkreative.com to see what I mean.

Can anyone help with a .fla source file that i can tear appart?

Any help would be coolio!!!

J.

Fading Random Images In And Out
Hello gang!
I am really having some trouble accomplishing a particular effect. I have spent 1 1/2 days trying to do this with no luck. It doesn't help that I am lousy with ActionScripting either.

What I would like to do is this:
I have 5 images that I would like to have loaded randomly. I'd also like them to fade in and out from one to the other as well.

If anyone can provide detailed instructions, I would greatly appreciate it. As I had mentioned, scripting is not my thing, so if you could please explain it in detail-assume that I know nothing-I would greatly appreciate it.

Thanks for your time and consideration!
Kind regards,
Greg

Fading Between Images In LoadMovie
Hi

I am using the loadovie command to pull in .jpegs for a slide show, but currently they load straight in. Is there a way to fade from one picture to another using the loadMovie command?

Thanks

Fading Through Images Without Tweening
I want a movie clip to fade through several images without tweening them, yet have no idear how to accomplish this..

so i have 6 images the first image will fade in then pause for about 100fms, then the next image will fade in and so on..

can anyone help?

Copyright © 2005-08 www.BigResource.com, All rights reserved