Loaded Image Not Fading Up, Going Mad
HiThis is really doing my head in as i have used the same proccess successfully before. This is the bit thats really annoying me. Loading in images from xml and using a listner to fade up to 100 alpha (using mctwee2 thingy) when loaded, but its not playing ball.Code: #include "mc_tween2.as"/////////////////////////////set varsvar pink:String = "0xEC0B8D";var grey:String = "0x7E8082";var picNum:Number = -1;var nextNum:Number = -1;//////////////////////////////////////////////////load sections functionvar imageLoader:MovieClipLoader = new MovieClipLoader();var imageListener:Object = new Object();imageLoader.addListener(imageListener);imageListener.onLoadInit = function():Void { trace("second = "+imagesMC["picMC"+nextNum]); //this is what isnt working imagesMC["picMC"+nextNum].tween("_alpha", 100, 0.5, "linear"); }function loadPic(){ nextNum = imagesMC.getNextHighestDepth(); imagesMC.attachMovie("pic", "picMC"+nextNum, imagesMC.getNextHighestDepth(), {_y:0, _x:0, _alpha:50}); imageLoader.loadClip(galleryArray[picNum], imagesMC["picMC"+nextNum]);}////////////////////////////////generate buttons from xmlfunction generate(){ //trace("generate"); var targX:Number = 0; for(i=0,j=1;i<xmlLength;i++,j++){ //add button clip from library _root.attachMovie("galleryBut", "galleryBut"+i, _root.getNextHighestDepth(), {_y:230, _x:targX, _alpha:100}); //set number for button, if less than 10 add 0 if(j < 10){ _root["galleryBut"+i].numText.htmlText = "<b>0"+j+"</b>"; } else { _root["galleryBut"+i].numText.htmlText = "<b>"+j+"</b>"; } //set new x pos for next itteration targX += 18.8; //set button actions var newBut:MovieClip = _root["galleryBut"+i]; newBut.num = i; newBut.onRelease = function(){ if(this.num != picNum){ picNum = this.num; loadPic(); changeButColor(); } } newBut.onRollOver = function(){ this.solidMC.colorTo(pink, 0.3, "linear"); } newBut.onRollOut = function(){ if(this.num != picNum){ this.solidMC.colorTo(grey, 0.3, "linear"); } } } }//set all buttons apart from currently selected back to greyfunction changeButColor(){ for(i=0;i<xmlLength;i++){ if(i != picNum){ _root["galleryBut"+i].solidMC.colorTo(grey, 0.3, "linear"); } } }////////////////////////////////////////////////////////////////////////////////////////////////load xml and populate arraysvar xmlData:XML = new XML();xmlData.ignoreWhite = true;var profileArray:Array = new Array;var imageArray:Array = new Array;var nameArray:Array = new Array;var tagArray:Array = new Array;var galleryArray:Array = new Array;var xmlLength:Number;xmlData.onLoad = function(){ xmlLength = this.childNodes[0].childNodes.length; for(i=0;i<xmlLength;i++){ profileArray.push(this.childNodes[0].childNodes[i].attributes.profile); imageArray.push(this.childNodes[0].childNodes[i].attributes.profileImage); nameArray.push(this.childNodes[0].childNodes[i].attributes.profileName); tagArray.push(this.childNodes[0].childNodes[i].attributes.profileTags); galleryArray.push(this.childNodes[0].childNodes[i].attributes.galleryImage); } generate();}xmlData.sendAndLoad("http://www.rsvplondon.co.uk/beta/includes/gallery-spotlight.xml.php", xmlData, "POST");stop();http://www.raw-nerve.co.uk/outgoing/rsvp/gallery_spotlight.zipprobably something very simple but im either stupido or blind. Thanks in advance
Actionscript 2.0
Posted on: Thu Mar 08, 2007 4:18 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fading And Copy A Dynamic Loaded Image
peepz,
my script for loading dynamic images (still whitout preloader but i can fix that):
Code:
holder = _root.mcPhotoShow.mcImageHolder1;
temp_mc.onRelease = function () {
unloadMovie(holder)
loadMovie(myUrlArray[this.i], holder);
};
the movie loads fine in the first keyframe (but i want to let this image fade-in (with alpha)
then i want to place another holder in this movieclip named "_root.mcPhotoShow" but on the 30th keyframe
that is an exact copy of the first loaded image but i want to scale this one to 31% and fade it also in (in the time this one is fading in i want to let the first holder fade out)
how can i fix this (i tried it but if i load in the 30th keyframe he doesn't load anything
i hope some flashkitter can give me a clear answer cause im a noob...
Fading And Copy A Dynamic Loaded Image
peepz,
my script for loading dynamic images (still whitout preloader but i can fix that):
Code:
holder = _root.mcPhotoShow.mcImageHolder1;
temp_mc.onRelease = function () {
unloadMovie(holder)
loadMovie(myUrlArray[this.i], holder);
};
the movie loads fine in the first keyframe (but i want to let this image fade-in (with alpha)
then i want to place another holder in this movieclip named "_root.mcPhotoShow" but on the 30th keyframe
that is an exact copy of the first loaded image but i want to scale this one to 31% and fade it also in (in the time this one is fading in i want to let the first holder fade out)
how can i fix this (i tried it but if i load in the 30th keyframe he doesn't load anything
i hope some ultrashocker can give me a clear answer cause im a noob...
Loaded External Image Question: Use Default Image If Loaded Image Not Found?
Hello,
I use the following code to load an external logo into a Flash Movie.
Quote:
var myRequest:URLRequest=new URLRequest(logoPath);
var loader:Loader = new Loader();
loader.load(myRequest);
holder_mc.addChild(loader);
What if the logo file is not find? I wish that if the logo is not found, another default logo will be used, i.e.
if (logoPath is here) {
var myRequest:URLRequest=new URLRequest(logoPath);
} else (logoPath is not here) {
var myRequest:URLRequest=new URLRequest("defaultlogo.png");
}
How can I do that?
Thanks and best regards
Alex
Fading A Black & White Image Into A Colour Image
I would like to load an image and then gradually and linearaly change the image from black and white into a full colour image over a set period of time. I would prefer to not have multiple images preloaded each with increasing colour saturation; as this produces too large a file and isn't linear. Can this be done elegantly please ?
Fading Image Over Previous Image
Hi there! Could need some help.
I'm making a movie with 8 different toppics/pages/sections. News, History, Products, Contact etc.
For each section I have a different background (in my case a different sky color). How do I manage that when a user chooses something in the menu, the sky/clouds slowly change color?
I think it can be done in two ways:
1. applying RGB actionscript (like the Advanced effect) to the sky/cloudimage (this image stays the same, only color should change) with some kind of a time interval.
2. make 8 movieclips of the different sky/clouds and fading them.
For example: how to change the yellow background sky/clouds of News into the green sky/clouds of Products when a visitor changes his choise in the navigation menu? etc.
Any ideas?
Hope someone can help me.
Thanx a lot!
G.
Fading In Loaded Swf.
Hi all,
I have a holder_mc that I'm loading a swf into, and I wanted it to fade in. I've done this code.
The prototype works fine in other situations. so I'm pretty sure it's not that.
Do i need to make sure the swf is fully loaded before doing something with it.
ActionScript Code:
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha == 100;
this.onEnterFrame = null;
}
};
};
holder_mc._alpha = 0;
one_btn.onRelease = function() {
holder_mc.loadMovie("image.swf");
holder_mc.fadeIn(10);
};
Fading In Loaded Swf.
Hi all,
I have a holder_mc that I'm loading a swf into, and I wanted it to fade in. I've done this code.
The prototype works fine in other situations. so I'm pretty sure it's not that.
Do i need to make sure the swf is fully loaded before doing something with it.
ActionScript Code:
MovieClip.prototype.fadeIn = function(speed) { this.onEnterFrame = function() { this._alpha += speed; if (this._alpha>=100) { this._alpha == 100; this.onEnterFrame = null; } };};holder_mc._alpha = 0;one_btn.onRelease = function() { holder_mc.loadMovie("image.swf"); holder_mc.fadeIn(10);};
Fading Out A Loaded Movie
I have placed a similar thread before in flash MX but maybe I didn't explain well.
I want to know if its possible to fade out a loaded movie contained in a cliploader in one frame. I have a button to make the action like control an alpha property of the loaded movie or the cliploader that contains the movie.
I have searched in all the forum threads but didn't find anything similar, maybe didn't see it or I forget to check them all...
I'm not an expert on flash actionsript, I'm using mx and a sample code will be helpful and an explanation of how it works will be great
thanks a lot
[F8] Fading Pics Loaded From Xml
Hi
I built this simple gallery but I need the pictures to fade in and out and i can't find anyting that will work, rather, I can't get anything to work. And if anybody can help me out with how to make a preloader that will show everytime I load a new pic that would be great.
this is the code I used
var x:XML = new XML ();
x.ignoreWhite = true;
var urls:Array = new Array ();
var captions:Array = new Array ();
var whatNumber:Number;
x.onLoad = function() {
var photos:Array = this.firstChild.childNodes;
for (i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whatNumber = 0;
}
x.load("XML/Gallery1/gallery.xml");
previous.onRelease = function () {
if(whatNumber > 0) {
whatNumber--;
holder.loadMovie(urls[whatNumber]);
caption.text = captions[whatNumber];
}
}
next.onRelease = function () {
if(whatNumber < urls.length-1) {
whatNumber++;
holder.loadMovie(urls[whatNumber]);
caption.text = captions[whatNumber];
}
}
im using cs3 but with AS2 and I posted a copy of the fla.
thanx
Fading My Loaded MC Before Going To FrameLabel
I have the below code:
Code:
numOfBtn = 6;
stop();
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
gotoAndStop("frm"+(this.num+1));
};
this["btn"+i].onRollOver = function() {
this.play();
};
this["btn"+i].onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
}
I have six buttons, which animate onRollOver and reverse the animation onRollOut... onRelease it sends it to 'frm1-frm6' respectively depending on which button is pressed. Say for example btn1 is pressed and the user is taken to framelabel 'frm1'. On each framelabel I have this code:
Code:
var myTest = "images/manly/manly" + 2 + ".jpg";
_root.myLoader.loadClip(myTest,_root.myClip);
This loads a bg image, onto the stage. It calls myClip which plays from allpha 0-100. This is the code for myClip, so you can se what it does:
Code:
var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg";
Stage.align = "TL"; // Position the movie at top, center
Stage.scaleMode = "noScale"; // Prevent scaling (required!)
myListener.onResize = function (e:Object):Void {
var sw:Number = Stage.width;
var sh:Number = Stage.height;
mcl._width = sw;
trace("New width: " + Stage.width);
};
myListener.onLoadInit = function (mcl) {
trace("load init");
mcl._alpha=0;
mcl.onEnterFrame=function(){
mcl._alpha +=15;
if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};
Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);
Basically after all that! What I want to try and do is when 1 of the 6 buttons is pressed and it moves to a framelabel and loads the image into 'mcl', before it does this I want the old loaded image to fade out and then for the playhead to move to the new framelabel... Sorry it's really hard to explain on here sometimes... If anyone understands and can help me out would be much appreciated!
Fading A Dynamically Loaded JPG
OK guys,
Im new here, people look really helpful round these parts, so i guess im gonna give it a try.
MY PROBLEM
When a button is pressed i want an image to be loaded (from an external source). It will inititally be hidden, when (and only when) its fully loaded i want it to fade in............but at the same time the previous image must fade out.
Hopefully this will make it look like a seamless transition.
Ive been trying to get this to work for literally hours now and i'm in desperate need of some help.
Thanks for your time,
Elliott
Fading Loaded Movies
Hi!
I was hoping someone could help me with this!
I have an emty movieclip in which I load external swf.
What I want to do is when I press "menu1" button a swf is loaded in the MC contents. I want this swf to fade in, not a problem. BUT when "menu2" button is pressed, I want the first swf to fade out, before the new swf is loaded, and so on. The same way the pictures fade in an out in the photogallery-tutorial on this site.
any help would be great!
thx!!
Fading My Loaded MC Before Going To FrameLabel
I have the below code:
Code:
numOfBtn = 6;
stop();
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
gotoAndStop("frm"+(this.num+1));
};
this["btn"+i].onRollOver = function() {
this.play();
};
this["btn"+i].onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
}
I have six buttons, which animate onRollOver and reverse the animation onRollOut... onRelease it sends it to 'frm1-frm6' respectively depending on which button is pressed. Say for example btn1 is pressed and the user is taken to framelabel 'frm1'. On each framelabel I have this code:
Code:
var myTest = "images/manly/manly" + 2 + ".jpg";
_root.myLoader.loadClip(myTest,_root.myClip);
This loads a bg image, onto the stage. It calls myClip which plays from allpha 0-100. This is the code for myClip, so you can se what it does:
Code:
var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg";
Stage.align = "TL"; // Position the movie at top, center
Stage.scaleMode = "noScale"; // Prevent scaling (required!)
myListener.onResize = function (e:Object):Void {
var sw:Number = Stage.width;
var sh:Number = Stage.height;
mcl._width = sw;
trace("New width: " + Stage.width);
};
myListener.onLoadInit = function (mcl) {
trace("load init");
mcl._alpha=0;
mcl.onEnterFrame=function(){
mcl._alpha +=15;
if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};
Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);
Basically after all that! What I want to try and do is when 1 of the 6 buttons is pressed and it moves to a framelabel and loads the image into 'mcl', before it does this I want the old loaded image to fade out and then for the playhead to move to the new framelabel... Sorry it's really hard to explain on here sometimes... If anyone understands and can help me out would be much appreciated!
Fading My Loaded MC Before Going To FrameLabel
I have the below code:
Code:
numOfBtn = 6;
stop();
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
gotoAndStop("frm"+(this.num+1));
};
this["btn"+i].onRollOver = function() {
this.play();
};
this["btn"+i].onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
}
I have six buttons, which animate onRollOver and reverse the animation onRollOut... onRelease it sends it to 'frm1-frm6' respectively depending on which button is pressed. Say for example btn1 is pressed and the user is taken to framelabel 'frm1'. On each framelabel I have this code:
Code:
var myTest = "images/manly/manly" + 2 + ".jpg";
_root.myLoader.loadClip(myTest,_root.myClip);
This loads a bg image, onto the stage. It calls myClip which plays from allpha 0-100. This is the code for myClip, so you can se what it does:
Code:
var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg";
Stage.align = "TL"; // Position the movie at top, center
Stage.scaleMode = "noScale"; // Prevent scaling (required!)
myListener.onResize = function (e:Object):Void {
var sw:Number = Stage.width;
var sh:Number = Stage.height;
mcl._width = sw;
trace("New width: " + Stage.width);
};
myListener.onLoadInit = function (mcl) {
trace("load init");
mcl._alpha=0;
mcl.onEnterFrame=function(){
mcl._alpha +=15;
if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};
Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);
Basically after all that! What I want to try and do is when 1 of the 6 buttons is pressed and it moves to a framelabel and loads the image into 'mcl', before it does this I want the old loaded image to fade out and then for the playhead to move to the new framelabel... Sorry it's really hard to explain on here sometimes... If anyone understands and can help me out would be much appreciated!
Fading In Dynamic Loaded Text?
I want to fade it in without having the look of the embedded fonts blured edges. I want no effect to the text, just plain. Is there a way to do this?
umm, here is an example http://www.thebeautifulmistake.com
Fading Between Dynamically Loaded Pictures
Hi everyone,
I've been trying to figure out a way to fade between pictures which are dynamically loaded into the site. Can this be done? Here is the code I have which will load a new background image every 5 seconds. I want the pictures to fade in and out during change. Please help.
backgrounds = new Array("pelican.jpg", "seagull.jpg", "caterpillar.jpg");
function randomBackground() {
randomNumber = random (backgrounds.length);
loadMovie (backgrounds[randomNumber], "_root.placeholder");
}
randomBackground();
setInterval(randomBackground, 5000);
Fading Externally Loaded Images
Hi!
I created a Flash movie with a graphic symbol containing an embedded JPEG. I faded the symbol in and out by creating a motion tween between an instance of the symbol at 0% Alpha color and another instance of the symbol at 100% Alpha color. When I tried to load the JPEG image from an external source using the Loader Component inside the graphic symbol (in stead of embedding it inside the graphic symbol as I had done previously) the fades disappeared. I can now only see the image when the Alpha color is 100%
Any help would be very much appreciated! : )
Thanks,
Leao
Fading Between Externally Loaded Jpeg's
Hi,
I am having problems with a site I am building which I can't figure out.
Here is what I need to do...
I have a movie that when run loads a jpeg into a blank movieclip. There are then 3 buttons on the stage that when clicked load a different jpeg in to the blank movie clip.
This works fine but I now need the images to fade between one antother. In other words, when the move runs the first default image needs to alpha up, then when the next button is clicked I need this image to alpha out load another image and then alpha this new image up.
I have been working with alphaing the blank movie clip to 0 then loading the new image and then alphaing the blank mc back up but I am having no luck and I am assuming that this is not the way you would/should do this.
can anyone help or point me to a tutorial that would explain this to me with big pictures and simple words as I am fairly new to AS.
Thanks
Steve
Fading Effect To Loaded Text
Hi,
I am creating a presentation. I want to load text from external text file and want to give it a alpha transection. But i am having trouble in it. can anybody help.
Please post your suggetions as soon as possible.
Thanks
Fading In Externally Loaded Images
Alright for some reason i'm having some trouble with this little bit of actionscript. I've never been great at it so i need a little nudge every once in a while.
Anyway, i've got an image gallery that is loading external images into empty movieclips that are on the stage. This all works fine. What i'm trying to do is give the larger image (medium_mc) a nice fade in once it loads. This is the script that i've got so far:
Code:
MovieClip.prototype.loadPic = function(pic){
medium_mc._alpha = 0;
medium_mc.loadMovie(pic);
medium_mc.onEnterFrame = function(){
var t = medium_mc.getBytesTotal(), l = medium_mc.getBytesLoaded();
if (t != 0 && l == t){
medium_mc._alpha += 5;
}
if (medium_mc._alpha>90) {
medium_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
What's happening with this is the image is staying invisible and never fades up.
So hopefully one of you awesome guys will glance over that and see what i'm doing. Thanks in advance.
Fading-In Dynamically Loaded Buttons
So, I was fooling around with XML and AS.
I finally managed it to load the buttons via the .xml file.
The only problem is, they all load at the same time.
Is it possible to set an interval to each button, so it fades one after another?
Like, I dunno. a 0.1 second per button?
Here is the code so far...
Code:
menu = new XML(); menu.ignoreWhite = true; menu.load("menu.xml");
menu.onLoad = function(){
items = this.firstChild.childNodes;
for(counter=0; counter<=items.length-1; counter++){
_root.attachMovie( "menu_item", "item"+counter, counter);
_root["item"+counter].boxname.text = items[counter].attributes.bname;
_root["item"+counter]._x = counter*18;
_root["item"+counter]._y = 225;
}
}
Fading On External & Dynamically Loaded Mp3
hey guys
After searching the forum for help. I've noticed that you can only fadein & fadeout on attached mp3's. What about dynamic & external loaded mp3's??
Any help is appreciated
Fading An Image
What I want to do is to fade in an image on rollOver.
I've the following code:
//this is what I have in the firs frame
function fade_mc(MC){
trace(MC._alpha)
while(MC._alpha < 100) {
MC._alpha++
trace(MC._alpha)
}
}
setProperty(mc_loader,_alpha,0);
//this is what I have in the moviclip(mc_loader)
onClipEvent(data){
_parent.fade_mc(this)
this._width = 79
this._height = 53
}
//And this is what I have in the button where I rollover.
on (rollOver) {
loadMovie("bad.jpg","_parent.mc_loader");
}
I made those trace's in the firs frame code to see if it's actually fading in the image... And it is but It's too fast that I can't see any diference...
Hope u could help me out with this cause my head is getting bad around this!
Fading An Image In And Out
how do i make an image appear to fade in and fade out? i swear there is a tutorial somewhere but i cant find it, so could someone help me out or point me in the right direction as to where its hiding please?
thanks,
Fading Image In And Out
Hi there,
Can anyone help with this ...
Got 6 buttons in a menu, each relating to a different background image.
When I hit button 1, image1 appears on the screen
when i hit button 2, image2 appears on the screen in place of image1
and so on ...
When an image is on the screen, I want the next image to fade in over the last image -- e.g. I click button 5 and it appears on the screen -- I then click image 2 and while image5 fades out, image 2 fades in ... and on and on and on.
anyone know where I should start with this?
Any help/suggestions you can give are greatly appreciated
Cheers
G
Fading Out An Image
Can someone tell me how to fade out an image like in photoshop?
I've already tried lots of things but I can't find a solution :s.
Maybe with masks and let the mask fade out into an invisible part or something.., but this doesn't works. :'(
I realy hope that someone can help me out
I'm sure you can
This is what I mean : Fade out image
Thanx in advance, sya
Help With Fading Image
i've been trying to get this right all night and i'm about ready to give up. how can i get an image (rather large) to just fade into the bakground before anything else shows up on the page? i.e. the background i have is white, the image is bluish. i want it to fade from white to the image, how can i get it to do that? thanks in advance.
Image Not Fading
I have text converted into a graphic. I have set it up to fade in and out, as I've done a thousand times before...works fine in the preview but not when I test it. It just appears...then stays there. I am doing everything right, but am stumped, any ideas?
Image Fading
How do you fade an image away and place another like this
http://www.cbs.com/primetime/survivor11/
Fading An Image In And Out?
I wish to fade text in and out using a motion tween keyframe.
I know how to create a motion tween but how do i fade the text in and out?
Robert
I'm using Flash MX
Image Fading Help Please
Hi
Can anyone help me out with image fading.
I have a flash file with 9 buttons, once a button is clicked eg: button 6, it will go to frame 6 which will fade in an image. Then say on this frame you click button 3, it will go to frame 3 which will fade in another image.
Now, is there a way of displaying an image from the frame you have just come from, in the new frame?
For example, say im on frame 6 and then click button 3 and go to frame 3, but i want the image in frame 6 to show up in frame 3.
Thanks
Fading A Image
I am new to Flash use Dreamweaver alot I made a slide show that works but trying to make it so when the image comes into view it is smoother I think the term is fade in and fad out BUT can not figure out how to make it do that
I use a older version flash 6
Thxs Steve
Fading An Image
Hi
Can anyone help? I have Flash 8 and I am tyrying to do no more than take an image and "fade it into" the same size (then fully shown) ultimate image.
I have tried using the probably excellent action scripts available - but nothing works.
To an expert this is Bread and Butter stuff I guess??
Can anyone help?
Also - any advice of the best site to find these types of very useful action scripts?
Thanks
Carl
Image Keeps Fading
i downloaded this handy slideshow [credit to the guy in the code]
The script works fine, but there's something i can't do. I'm that well versed in actionscript, so all help is appreciated.
I want to be able to place a picture on top of the slideshow [like on the top layer]. Just a simple logo on the right hand side. Whenever i insert the picture, it stays for the first image, but then also fades out with the first image. All i want is to be able to keep the image in the same place the whole time.
Is this possible? Can anyone help me with this problem?
here's the code
cheers in advance
Attach Code
/****************************/
/* Crossfading slide show */
/* Author: Todd Dominey */
/* http://whatdoiknow.org */
/* http://domineydesign.com */
/****************************/
// set random # variables - each must be 0 for first 'while' loop below
var randomNum = 0;
var randomNumLast = 0;
// parent container
var container_mc = this.createEmptyMovieClip("container",0);
// movie clip containers
container_mc.createEmptyMovieClip("loader1_mc",2);
container_mc.createEmptyMovieClip("loader2_mc",1);
// preload watcher
this.createEmptyMovieClip("watcher_mc",100);
// load xml
images_xml = new XML();
images_xml.ignoreWhite=true;
images_xml.onLoad = parse;
images_xml.load("images.xml");
function parse(success) {
if (success) {
imageArray = new Array();
var root = this.firstChild;
_global.numPause = Number(this.firstChild.attributes.timer * 1000);
_global.order = this.firstChild.attributes.order;
_global.looping = this.firstChild.attributes.looping;
_global.fadetime = Number(this.firstChild.attributes.fadetime);
_global.xpos = Number(this.firstChild.attributes.xpos);
_global.ypos = Number(this.firstChild.attributes.ypos);
var imageNode = root.lastChild;
var s=0;
while (imageNode.nodeName != null) {
imageData = new Object;
imageData.path = imageNode.attributes.path;
imageArray[s]=imageData;
imageNode = imageNode.previousSibling;
s++;
}
// place parent container
container_mc._x = _global.xpos;
container_mc._y = _global.ypos;
// parse array
imageArray.reverse();
imageGen(imageArray);
} else {
trace('problem');
}
}
// depth swapping
function swapPlace(clip,num) {
eval(clip).swapDepths(eval("container_mc.loader"+num+"_mc"));
}
function loadImages(data,num) {
if (i==undefined || i == 2) {
i=2;
createLoader(i,data,num);
i=1;
} else if (i==1) {
createLoader(i,data,num);
i=2;
}
}
function createLoader(i,data,num) {
thisLoader=eval("container_mc.loader"+i+"_mc");
thisLoader._alpha=0;
thisLoader.loadMovie(data[num].path);
watcher_mc.onEnterFrame=function () {
var picLoaded = thisLoader.getBytesLoaded();
var picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes < 4) {
return;
}
if (picLoaded / picBytes >= 1) {
swapPlace("container_mc.loader2_mc",1);
alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_global.fadetime,true);
timerInterval = setInterval(imageGen,_global.numPause,data);
delete this.onEnterFrame;
}
}
}
function imageGen(data) {
// random, or sequential?
if (_global.order=="random") {
// choose random # between 0 and total number of images
while (randomNum == randomNumLast) {
randomNum = Math.floor(Math.random() * data.length);
trace(randomNum);
}
loadImages(data,randomNum);
randomNumLast = randomNum;
} else if (_global.order=="sequential") {
// start at 0, increment to total number of images, then drop back to zero when done
if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
loadImages(data,p);
p++;
} else {
trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
}
clearInterval(timerInterval);
}
stop();
Image Fading
Hi
Can anyone help me out with image fading.
I have a flash file with 9 buttons, once a button is clicked eg: button 6, it will go to frame 6 which will fade in an image. Then say on this frame you click button 3, it will go to frame 3 which will fade in another image.
Now, is there a way of displaying an image from the frame you have just come from, in the new frame?
For example, say im on frame 6 and then click button 3 and go to frame 3, but i want the image in frame 6 to show up in frame 3.
Thanks
Fading An Image
Hi,
Using Flash MX
How do you fade an image gradualy revealing it, from the top left corner to the bottom right.
i.e. a black movie, the image in the centre as a background, a black box layer covering the image which fades on a diagnol from the top left corner to reveal the backgound image.
I figure it must be using the alpha value and a motion tween as with a standard image/text fading, however I am unsure how to reveal in the diagnol manner.
Thanks.
Fading An Image
How do you fade a graphic on mouseover, and then have the graphic return to its original alpha on mouseout?
Basically what I want to do is have the graphic fade to around 50% alpha on mouseover and then fade back to 100% alpha on mouseout.
I am really stuck on this, any help is appreciated.
Thanks
Image Fading And CPU
Sup All!
I've heard there are alot of knowledgable flasher's here.(Flash MX not flash your privates lol!)
So i've got a question about image fading.
In my movie i'm fading a prety large image (750x300) and its pinging my CPU at 60% 8-0.
I was wondering if this just comes wih fading a large image or would fading a mask over the image be more efficient?
Here's the Movie
The background fades every 20 seconds.
And thanks in advance for sharing your know-how
[edit]Flash MX 2004 Pro[/edit]
Fading An Image
Hi,
Using Flash MX
How do you fade an image gradualy revealing it, from the top left corner to the bottom right.
i.e. a black movie, the image in the centre as a background, a black box layer covering the image which fades on a diagnol from the top left corner to reveal the backgound image.
I figure it must be using the alpha value and a motion tween as with a standard image/text fading, however I am unsure how to reveal in the diagnol manner.
Thanks.
Fading An Image
How do you fade a graphic on mouseover, and then have the graphic return to its original alpha on mouseout?
Basically what I want to do is have the graphic fade to around 50% alpha on mouseover and then fade back to 100% alpha on mouseout.
I am really stuck on this, any help is appreciated.
Thanks
Image Fading And CPU
Sup All!
I've heard there are alot of knowledgable flasher's here.(Flash MX not flash your privates lol!)
So i've got a question about image fading.
In my movie i'm fading a prety large image (750x300) and its pinging my CPU at 60% 8-0.
I was wondering if this just comes wih fading a large image or would fading a mask over the image be more efficient?
Here's the Movie
The background fades every 20 seconds.
And thanks in advance for sharing your know-how
[edit]Flash MX 2004 Pro[/edit]
Fading In Swf's Loaded Into A Movie Clip Holder
fading in swf's loaded into a movie clip holder
hi all,
i'm trying to make a simple click-through gallery of images where each image is an external swf to be loaded into a movie clip called "holder" in the main movie. not too tough, but i'd like each image to fade in as the button is clicked, rather than just appear. i could put the fade in at the start of each external swf, but there must be a more elegant way to do it, like use a fade-in on the clip "holder" itself, and cause that to run each time a new image is loaded into it.
anyone know how to do that?
Fading Dynamically Loaded Swf Files Containing Images
Hi everyone!
I really need help. Iīm working on a solution to load 22 swf files into a main swf and then fade them in and out while browsing through them all(pushing buttons).
I donīt want to load them at the same time but when the user pushes another button then i wanīt to load the next and so on(all with a preloader).
I have made an example where i succeeded doing this but with one big fla wich dosenīt work with more then 10 images. I really need to load them dynamically and fade them over each other. Iīll submit the swf that i have made.
Hope someone can help me!!!
//Johan
Cross-fading Loaded Movie Clips
I have a movie into which other movies are being loaded. I have one button for each movie.
My problem is I want to cross-fade movies when the one that is currently loaded is being replaced by another movie. I'm a true novice at ActionScripting so any help given is greatly appreciated.
Here is the actionscript I have so far:
button1.onPress=function(){
loadMovie ("D Wall Animation.swf", "_root.content");
}
button2.onPress=function(){
loadMovie ("R Wall Animation.swf", "_root.content");
}
button3.onPress=function(){
loadMovie ("T Wall Animation.swf", "_root.content");
}
button4.onPress=function(){
loadMovie ("S Wall Animation.swf", "_root.content");
}
button5.onPress=function(){
loadMovie ("S2 Wall Animation.swf", "_root.content");
}
Externally Loaded SWF Fading Out Audio In Parent SWF
Hi eveyrone!
I'm new to the forum and (relatively) new to Flash. I hope I've come to the right place to get some help!
I have an empty SWF (holder.swf) that loads an external MP3 (audio.mp3) and plays it. I have a button in my HTML that, when clicked, it loads a SWF (loop1.swf) inside holder.swf.
Loop1.swf has it's own audio. Because of that, I want it to fade-out the audio in holder.swf, and then disable it. That way the audio from loop1.swf will be the only sound.
Once loop1.swf ends, I want to fade the audio back into holder.swf and start the music over again.
I am having a truly beast of a time doing this. My sound is loaded into holder.swf pretty simply, using this code:
var audio:Sound = new Sound();
audio.loadSound("audio.mp3", true);
Can anyone help me with the rest? What code do I put into loop1.swf to fade out the audio in it's parent layer, but keep it's own? Then, how do I fade back in the audio into the parent layer and start the track over?
Thank you all!
Chris
Problem When Alpha Fading A Loaded Movie
I know there have been many posts on this, many of them from myself but I seem to have trouble once the situation is slightly different from an already posted situation.
I am trying to slowly fade a loaded movie (fade the container clip) trouble is, I can get it to _alpha = 0; but it jumps, does not fade.
Here are two examples of the code I have been testing
(I gave up on the first one, which is why I tried the second and it's still not working)
This seems to jump to an alpha of about 20%:
Code:
function fadeRMS() {
clearInterval(fadeRMSInterval);
if (_root.holder24._alpha >= 0)
{
_root.holder24._alpha -= 20;
}
else{
delete this.onEnterFrame;
}
}
fadeRMSinterval = setInterval(fadeRMS, 60000);
and this jumps directly to zero:
Code:
function fadeRMS() {
_root.holder24._alpha -= 4;
if (_root.holder24._alpha > 0) {
_root.holder24._alpha = 0;
delete this.onEnterFrame;
}
};
fadeRMS = setInterval(fadeRMS, 60000);
Could someone let me know what I am doing wrong? I will continue to test, it may be as simple as a - where there should be a + or < where there should >.
That just gets very time consuming.
Also, could you please tell me if one of these ways is better than the other, and why?
Problem When Alpha Fading A Loaded Movie
I know there have been many posts on this, many of them from myself but I seem to have trouble once the situation is slightly different from an already posted situation.
I am trying to slowly fade a loaded movie (fade the container clip) trouble is, I can get it to _alpha = 0; but it jumps, does not fade.
Here are two examples of the code I have been testing
(I gave up on the first one, which is why I tried the second and it's still not working)
This seems to jump to an alpha of about 20%:
Code:
function fadeRMS() {
clearInterval(fadeRMSInterval);
if (_root.holder24._alpha >= 0)
{
_root.holder24._alpha -= 20;
}
else{
delete this.onEnterFrame;
}
}
fadeRMSinterval = setInterval(fadeRMS, 60000);
and this jumps directly to zero:
Code:
function fadeRMS() {
_root.holder24._alpha -= 4;
if (_root.holder24._alpha > 0) {
_root.holder24._alpha = 0;
delete this.onEnterFrame;
}
};
fadeRMS = setInterval(fadeRMS, 60000);
Could someone let me know what I am doing wrong? I will continue to test, it may be as simple as a - where there should be a + or < where there should >.
That just gets very time consuming.
Also, could you please tell me if one of these ways is better than the other, and why?
Cross Fading Externally Loaded Swfs
Hey All,
I know this sounds similar to other posts. But, this is alittle different. I have used transitions between swfs where the first swf plays the intro, when the user clicks a button the first swf plays the 'outro' and loads the second swf intro. This not what I am looking for. I want the swfs to cross fade. I was thinking of using different layers. I have found a tutorial that seems to work but the action is on a button that loads the next swf in the array. I want to be able to pick any swf and have it cross fade with the one loaded in the holder.
Any Ideas? I will have at least 5 swfs to load.
//tutorial by Rich Shupe, FMA. http://www.fmaonline.com
/*
array of possible content to pick from. This article answered a question about swapping loaded SWF files with a transition, but this technique will also work with jpgs, without having to make swf files from them.
*/
swfArray = new Array("red_bird.swf", "chinatown_dragon.swf", "working_beast.swf");
//create two MovieClips that will hold the loaded files
this.createEmptyMovieClip("target1", 1);
this.createEmptyMovieClip("target2", 2);
//load first movie into clip 1 to start with the first image
target1.loadMovie(swfArray[0]);
//set clip2 alpha to zero so it can fade in
target2._alpha = 0;
//variables that store current clip and current content index
activeTarget = target1;
currentIndex = 0;
/*
movie-level enterFrame event handler that will fade down object 1 (if it's alpha is higher than zero), and fade up object 2 (if it's alpha is less than 100)
*/
this.onEnterFrame = function() {
if (obj1._alpha>0) {
obj1._alpha -= 10;
}
if (obj2._alpha<100) {
obj2._alpha += 10;
}
//enable trace to watch memory used by each loaded movie. this will illustrate the
// benefits of unloading the faded movie.
//trace("clip1: " + clip1.getBytesTotal() + " clip2: " + clip2.getBytesTotal())
};
//button script that swaps load target focus and loads the next movie
nextButton.onRelease = function() { // I want to put the action on individual buttons
//toggles values of object 1 and 2 between clip 1 and clip 2
if (activeTarget == target1) {
obj1 = target1;
obj2 = activeTarget=target2;
} else {
obj1 = target2;
obj2 = activeTarget=target1;
}
//assigns content of object 2 as next item in the content array, unless the
// end of the array has been reached. in this case start over at first item
if (currentIndex<swfArray.length-1) {
currentIndex++;
} else {
currentIndex = 0;
}
//load content into second clip
obj2.loadMovie(swfArray[currentIndex]);
//to reduce possible RAM and performance overhead, add an onEnterFrame
// event handler to object 1 to unload it once it has faded out.
//once the movie has unloaded, delete the onEnterFrame event handler
// to prevent future loads from unloading.
obj1.onEnterFrame = function() {
if (this._alpha<=0) {
this.unloadMovie();
delete this.onEnterFrame;
}
};
};
Dynamic Image Fading?
Eh, I am a complete Flash Newb and I need some help. I need flash to pull image files from a folder, fade them in, pause 5 seconds, fade image out, fade in new image.. etc until it runs out of images. Is there any way actionscript can do this???
I should have stuck to programming PHP.. so much easier..
|