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




Loading Random Fullscreen Background Image



so, i finally got the fullscreen / scaling background to work. AND i can add .swf's and other mc's over top of it without any problem. however, i want to be able to have the background image randomly generated. i know how to do that on its own, but i can't get it to work with this script. any advice? here's my fullscreen / scaling bg script.
Quote:




Stage.scaleMode = "noScale";_global.imgConstantWidth = bgImage._width;_global.imgConstantHeight = bgImage._height;setImage = function(mc){ var originalWidth = 1280; var originalHeight = 850; var widthGutter = (Stage.width - originalWidth)/2; var heightGutter = (Stage.height - originalHeight)/2; mc._x = -widthGutter; mc._y = -heightGutter; if (mc._width > Stage.width){ mc._x -= (mc._width-Stage.width)/2; } if (mc._height > Stage.height){ mc._y -= (mc._height-Stage.height)/2; } }resizeImage = function(mc){ var scaleByWidth; if (Stage.width/Stage.height > _global.imgConstantWidth/_global.imgConstantHeight){ scaleByWidth = true; }else{ scaleByWidth = false; } if (scaleByWidth){ mc._height = Stage.width * _global.imgConstantHeight / _global.imgConstantWidth; mc._width = Stage.width; } else { mc._width = Stage.height * _global.imgConstantWidth / _global.imgConstantHeight; mc._height = Stage.height; }}setImage(bgImage);resizeImage(bgImage);sizeListener = new Object();sizeListener.onResize = function() { setImage(bgImage); resizeImage(bgImage);};Stage.addListener(sizeListener);



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-21-2008, 11:04 PM


View Complete Forum Thread with Replies

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

Random Fullscreen Background Image On Refresh
Hi there, I have flash site and client wants random fullscreen background image to load on refresh. sounds easy right ?. but i've tried a lot of components and code snippets but it's causing headaches as nothing seems to work. i have a client squirming because it isn't done and i was wondering if you could help me out.

I did purchase a component from flashden (randombgholder) which does exactly what i want, but it seems to clash with the flashloaded fCMS system i have working in place, and somehow knocks it out, but that could be my bad amateur flash coding causing it. And when i go to center the swf over the background using his code he provided it goes haywire.
perhaps i could do a random fullscreen background image on page refresh in html?? i tried some css ones, but nothing works probably because i'm very new to flash and the likes.
links to tutorials or someone i could even pay to do this - anything really appreciated.
THanks in advance, Angie.

AS 2 Loading Random Background FULLSCREEN Images
Hi there,
I have been looking at this tutorial http://www.kirupa.com/developer/mx/l...background.htm

but I need the background images to be FULLSCREEN. Can someone help me out? Is there a way to do this that someone can point me to ? I have a client squirming, and my head is on the block.

I am using as2, flash cs3.

Thanks in advance, Angie.

[F8] Loading A Random Background Image And Preloading It.
Hey guys, currently making a new site. It is a fluid layout so everything streches etc. I am loading in a different background image each time the site is loaded and I have a good code for that from here:

http://www.kirupa.com/developer/mx/l...background.htm

But since the image needs to take up a lot of space on stage for things like 22" screens the image sizes are like 2MB. Is there anyway that I can preload the background image seperatly to the whole movie...well actually I know there is I just need to be pointed in the right direction or just given some help. I want the preloader to load the whole stage but then where the background image should be displayed a preloader is displayed until the background image has fully loaded.

Any help would be awsome!

thanks.

Loading A Random Background Image With A Preloader
hello

I've been following the Loading a Random Image tutorial from kirupa but I can't seem to make my image*.swf's to work..in it all I have is 3 frames, where the first 2 frames are for the preloader and the 3rd one is for the image.. but all I get is the loadBar fully loaded (but with no animation, just static) and no image... does that code from the kirupa tutorial stop the *.swf to make anykind of anymation?


another question is about how to simple load a movie on enter frame with a movieclip defining the location where it should be loaded to.. shouldn't it be: location.loadMovie("movie.swf") ? simply.... no?

thanks in advance..

Fullscreen Background Image
i'm developing a site that has a fullscreen background image, similar to what www.hi-res.net use (see www.massiveattack.com/start.html), but i'm finding that it's causing a few problems.

first it doesn't resize as the window's resized as smoothly as the ones hi-res use, and also, it seems to require alot of processing power, which i'm assuming is because it's continually looping a fairly large image.

here's the AS i'm using...


Code:
myImage._width = System.capabilities.screenResolutionX;
myImage._height = System.capabilities.screenResolutionY;
myImage.onResize = function () { this._x = (Stage.width-this._width)/2;this._y = (Stage.height-this._height)/2;};
Stage.addListener(myImage);
myImage.onResize();
this script is on an MC that contains the image, with a gotoAndPlay(1) on the next frame.

does anybody have any suggestions or alternative ways of achieving the same effect?

cheers

Have A Background Image In Fullscreen
Hi I just have two question

1)
How can I create a fullscreen flash with a image in the back that dont distort the image if the visitor have not so big screensize or if the visitor have a widescreen or not.

2)
What size is the background image going to be so it fit nice to both widescreen and not widescreen?

I was thinking about create a fullscreen flash and have a nice backgrund image but I dont want to distort the image.

Fullscreen Background Image?
Hi, im trying to make a background image on full html screen like this one at

http://www.refune.com/index_main.html

but i cant for the life at me get it to work right.

I have got it to scale using this code below

Stage.scaleMode = "noBorder";
var stageListener = new Object();
Stage.addListener = (stageListener);
stageListener.onResize = function() {
background._height = Stage.height;
background._width = Stage.width;
};

it scales but pixelates and doesnt seem to scale like the website, any help would be appriciated im pulling my hair out on this!

Also im using a JPEG image but it pixelates when i resize the HTML page so i am wondering if the image should be of an another format?

Fullscreen Background Image
Hi everyone!

I want to achieve a similar effect like this website - www.minus.dk -

If you try to resize the browser window you'll see that when the background picture is loosing it's original proportions it doesn't scale it anymore, it just hides parts of it.

I can make the image occupy 100% of the browser area, I just don't know how to make it "smart" the way that when it reaches a certain width/height it no longer scales.

Thx in advance.

[AS2] FullScreen Cross Fading Background Image XML Slideshow
Hi,

A student of mine wanted to know how to do this, so I made this example for them. Basically it is a Full Screen Random Background Image XML slideshow. It uses the bitmap data object to create a smoothed background image, crossfade between new images and has the ability to turn scaling off at a certain user defined size. I borrowed some code from fr-ode's example (image resizing) and have added in the XML and cross fading element. The code is well commented, you should be able to figure it all out.

EDITS
OK, I've pushed all the slide show settings into the xml file. The cross fading now occurs contained within a movieClip on the stage, rather than by creating dynamic movieClips, this should make it easier to simply layer your manually created content over this movieClip.

Also, included source .flas.

You will need:
1/ Some large images
2/ An XML file, that points to these images
3/ Set your publish settings to 100% browser width/height etc
4/ TweenLite AS2 Class http://blog.greensock.com/tweenliteas2

Limitations
1/ Using the min height/ width stop scaling can cause a slight jump if a user resizes the window up again beyond that size. This is because Flash has to suddenly rescale the image to match the browser window, and there is a brief lag. This is only a problem if a user is madly resizing the window, most don't.

2/ The temp cross faded image is not bitmap smoothed, for a slight time it may look a little jagged. I didn't bother going to the extra steps to make this image smoothed.

Enjoy.
EXAMPLE
Example 1 Min Image Time

SOURCE FILES
http://www.noponies.com/dev/fullscre...llCrossXML.zip

PHP Code:



/*******************************************CROSS FADING BACKGROUND FULLBROWSER IMAGEShttp://www.noponies.comhttp://www.eolian.net.nz************************************************************************************CONFIGURE THE XML FILE FOR ALL SLIDE SHOW PARAMETERS!!******************************************Version 1 - Initial ReleaseVersion 1.1 - bumpyknuckles fix where an onloadStart listener function has been added tothe AS to help avoid an issue where the temp bitmap shows up occassionally. Version 1.2 - Moved to tweenLite, fixed an image display issue when a user may resize the browser when the first image is loading in. Credit toxxneon off ActionScript.org forums for pointing out this issue.Terms and Conditions of usehttp://www.blog.noponies.com/terms-and-conditions*///init import flash.display.BitmapData;Stage.scaleMode = "noscale";import gs.TweenLite;stop();//load in background images XML detailsvar backImage:XML = new XML();backImage.ignoreWhite = true;var bgImages:Array = new Array();var p:Number = 0;//track pos in arrays//Variables pulled in from XMLvar minHeight:Number;var minWidth:Number;var crossFadeTime:Number;var imageTime:Number;var order:String;backImage.onLoad = function(success:Boolean) {    if (success) {        //get vars from XML file        minHeight = this.firstChild.attributes.minHeight;        minWidth = this.firstChild.attributes.minWidth;        crossFadeTime = this.firstChild.attributes.crossFadeTime;        imageTime = this.firstChild.attributes.imageTime;        imageTime = (1000*60)*imageTime;        order = String(this.firstChild.attributes.order);        p = 0;        bgImages = [];//reset the array var, should for some reason you want to load in a different set of images        xmlNodes = this.firstChild;        largeImages = xmlNodes.childNodes.length;        for (i=0; i<largeImages; i++) {            bgImages[i] = xmlNodes.childNodes[i].childNodes[0].firstChild.nodeValue;        }        //load random image when we successfully parse XML        loadRandomBitmap();    } else {        trace("Fatal Error - Loading background image XML failed");    }};//name of your xml filebackImage.load("backimages.xml");/*create an empty mc to act as the background smoothed bitmap holderchange the depth etc here should you need to..Note that this is created inside thesmall mc on the stage*/bgHolder_mc.createEmptyMovieClip("bg_mc",1);//var to track the fading, we use this to try to resize the temp bitmap with a resize, should the user be resizing the window when we fade in outvar fadingComplete:Boolean = true;var firstRun:Boolean = true;//BITMAP BACKGROUND LOADING///function loadRandomBitmap():Void {    if (order == "random") {        //create the temp loader mc that we load our unsmoothed bitmap into        //a limitation of this approach is that as this top image fades in/out it looks a little jagged for 2 seconds or so..        bgHolder_mc.createEmptyMovieClip("bg_loader",2);        //random function for loaded images        randomImg = Math.floor(Math.random(bgImages.length)*bgImages.length);        bitLoader.loadClip(bgImages[randomImg],bgHolder_mc.bg_loader);    } else {        //sequential loading of images        bgHolder_mc.createEmptyMovieClip("bg_loader",2);        bitLoader.loadClip(bgImages[p],bgHolder_mc.bg_loader);        p++;        if (p == bgImages.length) {            p = 0;        }    }}//MovieClipLoader for bitmap image loadingvar bitLoader:MovieClipLoader = new MovieClipLoader();var bitlistener:Object = new Object();bitlistener.onLoadStart = function(target:MovieClip):Void  {    //alpha out our image we load our bitmap into    target._alpha = 0;};bitlistener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void  {    //amountLoaded = Math.floor((bytesLoaded/bytesTotal)*100);//calulate a loading percentage!    //do something with this data if you want};/*here we both draw our bitmap to our offscreen MC and handle the cross fading in and out - First we load our bitmap into our temp mc which is set to alpha 0, then we resize and fade ourtemp mc in so that we achieve the cross fading effect. When the temp MC is at 100% alpha weattach our bitmap object to our smoothed background MC and then quickly fade out and remove the temp MC.*/bitlistener.onLoadInit = function(target:MovieClip):Void  {/*clear the timer interval each time. We do this so that each new iteration of the timerstarts from when the bitmap is loaded, this stops us from trying to fade images etc that have not loadedand ensures that each bitmap is displayed for the required amount of time on screen. Essentially it negates download time*/    clearInterval(bitmapFadeInterval);    //create the bitmap object, each time this is reset, keeping memory footprint fairly low..    var bitmap:BitmapData = new BitmapData(target._width, target._height, true);    //draw the bitmap    bitmap.draw(target);    //we are starting to fade, so set our var to false and let the temp resize functions run    fadingComplete = false;    //resize the temp bitmap to match the size of the bg bitmap    this.resizeTemp = function() {        if (Stage.height/Stage.width>target._height/target._width) {            img_propa = target._width/target._height;            target._height = Stage.height;            target._width = Stage.height*img_propa;            target._y = 0;            target._x = 0;        } else {            img_propa = target._height/target._width;            target._width = Stage.width;            target._height = Stage.width*img_propa;            target._y = 0;            target._x = 0;        }    }    this.resizeTemp();    //fade in the temp bitmap    TweenLite.to(target,crossFadeTime,{_alpha:100, onComplete:fadedIn, onCompleteParams:[this], onUpdate:this.resizeTemp});    function fadedIn(ref):Void {        ref.resizeTemp        //attach our loaded bitmap to our background mc when the temp totally obscures it        //this is the smoothed bitmap        bgHolder_mc.bg_mc.attachBitmap(bitmap,0,"auto",true);        //make the bg resize        fullScreenBg();//This is  abit of a hack to catch user resizes        TweenLite.to(target,.1,{_alpha:0, onComplete:cleanUpTemp});        function cleanUpTemp():Void {            //remove the temp mc            removeMovieClip(bgHolder_mc.bg_loader);            //we are done fading..            fadingComplete = true;        }        //reset the timer        bgHolder_mc.bg_mc.attachBitmap(bitmap,0,"auto",true);        bitmapFadeInterval = setInterval(_root, "loadRandomBitmap", imageTime);        //resize the bg image        fullScreenBg();        //add the stage listener, which fixes an issue with the image being scaled out to        //some crazy size if a user is resizing as the image loads in for the first time.        if (firstRun) {            Stage.addListener(catchStage);//stage resize listener, added here after first image load.            firstRun = false;        }    }};bitLoader.addListener(bitlistener);//stage listener to handle resizing imagesvar catchStage:Object = new Object();catchStage.onResize = function() {        /*simple "OR" conditional to set a min size, if we are below that we don't do any more scaling    note that we wrap this in a if/else so that the function that we actually use to to the bg    resizing can be called independently of this check, for instance when we are below the resize    min but we are fading in a new image, obviously we would want that new image to scale*/     //**IF YOU WANT TO SCALE AT ALL STAGE SIZES, SET THE MIN HEIGHT ETC TO 0 IN THE XML    if (Stage.width<minWidth || Stage.height<minHeight) {        return;    } else {        //call the resize function        fullScreenBg();    }};//screen resize functionfunction fullScreenBg() {    if (Stage.height/Stage.width>bgHolder_mc.bg_mc._height/bgHolder_mc.bg_mc._width) {        img_prop = bgHolder_mc.bg_mc._width/bgHolder_mc.bg_mc._height;        bgHolder_mc.bg_mc._height = Stage.height;        bgHolder_mc.bg_mc._width = Stage.height*img_prop;        bgHolder_mc.bg_mc._y = 0;        bgHolder_mc.bg_mc._x = 0;    } else {        img_prop = bgHolder_mc.bg_mc._height/bgHolder_mc.bg_mc._width;        bgHolder_mc.bg_mc._width = Stage.width;        bgHolder_mc.bg_mc._height = Stage.width*img_prop;        bgHolder_mc.bg_mc._y = 0;        bgHolder_mc.bg_mc._x = 0;    }} 




Here is now the xml looks;


PHP Code:



<?xml version="1.0" encoding="utf-8" standalone="yes"?><!--   - DALESATTLER - www.noponies.com'crossFadeTime' |#| time in SECONDS of the cross fade between images - Default is 3 seconds'imageTime' |#| how long in MINUTES do you want each image to display for. Note you can enter.5 etc for 30 seconds. Default = 1min'minWidth' |#| Minimum screen size width at which point the images will not be scaled - Default is 0 = no min point'minHeight' |#| Minimum screen size height at which point the images will not be scaled - Default is 0 = no min point'order' |#| random or sequential image loading - choose either "random" or "ordered" = Default is random--><images crossFadeTime="3" imageTime="1" minWidth="0" minHeight="0" order="ordered">     <back>        <image>images/band.jpg</image>    </back>    <back>        <image>images/back3.jpg</image>    </back>  <back>        <image>images/wave1.jpg</image>    </back> </images>

Help Random Background Image
Hello guys, i need a hand please!!
Im trying to do a site but with a random backround.. add like 5 different images and make the background fit in the resolution of all computers and every minute make them change with an effect!
please if someone knows how can i do this that is not creating a movie clip symbol with animation cause that wont be random and wont fit in all resolutions.
Thank you guys!!
roth

Random Background/image
what is the procedure to show a random background or navigation for my site? Thanks

Random Background Image Freaking Out?
Hi,

I have a movie clip with 9 frames. Each frame has a different image. Then I have AS to generate a random number and go to that number frame when the project is loaded (the whole thing is an exe on a CD by the way but the problem occurs whether I'm running it off my hard drive or the CD). It works great MOST of the time. The problem is that once in awhile when you load the project the random generator code seems to be ignored and all the images flash by, looping over and over. You have to close the project and relaunch to get it to stop.

Is there some way to fix this problem? This CD will be going to potential clients.

Thanks!
TS

Tile Background, Random External Image/swf
Hey all,

First post!
Anyways, I've been browsing around for a random tiled background and pieced together some components you guys have written, however its not working correctly?

The image(s) loads in the blank mc (named bc), however it does not tile?

loadMovie("bg_"+(Math.floor(Math.random()*3)+1)+". swf", "bg");
bg._visible = false;
w = bg._width;
h = bg._height;
y = _y;
for (iy=0; iy<20; iy++) {
x = _x;
for (ix=0; ix<24; ix++) {
n = "bg"+(iy*24+ix);
duplicateMovieClip("bg", n, 1+(iy*24+ix));
_root[n]._x = x+w/2;
_root[n]._y = y+h/2;
x += w;
}
y += h;
}

Any suggestions?

Loading A Random Background At 100%
how would you go about doing this. (ex http://hi-res.net )

I know how to do both indvidualy but i cant make it all work together!

any help would be apreciated

Loading Random Background
Hi, i read and completed the tutorial on this topic:

http://www.kirupa.com/developer/mx/l...background.htm

what i needed is something similar, except that my background image is a motion clip and instead of having external .swf, i need all the MC's in just one flash. How do i do that?
Thank you for a quick response


x.
Victor

Loading A Random Background
Hi everyone

This is my first post here, but i've used the excellent tutorials section on many occasions with great success

I now have a question re: Loading a Random Background

This will indeed work perfectly for what i want, my question is this;
can i get the same effect using jpgs from an external source?

thankyou for looking
Sue

Loading A Random Background At 100%
how would you go about doing this. (ex http://hi-res.net )

I know how to do both indvidualy but i cant make it all work together!

any help would be apreciated

How Do You Use Loading A Random Background On The Website
I found the loading random background tutorial
http://www.kirupa.com/developer/mx/l...background.htm,
so i follow through the tutorial to make my .swf file work as every time i open the .swf file, it gives me different background. However, when i insert its in my webpage, it gives me no response. It won't even load or do anything else at all, so is there anything i need to do or any specific code that i need to include when i insert it to my webpage so it'll load the new background everytime that i refresh the page?

By the way, the tutorial's really helpful, thank you!

Loading Random Background Tutorial Q.
I was just reading the testing the tutorials regarding loading a random background. I have tried this and worked!

BUT!...

I tried this for my flash document but the background covers everything else.

The keyframe, in which the script for loading the random image is in, is in a layer under a layer where my title is in. But when it loads the image, it appears on top of my image.

I'm trying to make an interactive DVD and want it so that my background changes each time you load the .swf file. (If possible to make it change also whenever you come back to the home page after visiting another page in it)

How do I solve this problem?

Question About Random Loading Background
I got the tutorial to work (it's pretty simple) but I want the background to randomly load images on it's on, basically looping through all of the random bacgrkounds without the page having to be refreshed. How do I achieve this? Thanks

Random Background When Loading Website
Hi there,

I'm new to Actionscript and was hoping somone could assist me with creating a random picture loader for my background, so that when you enter the website the picture in the background is different every time you enter.

Thanks for any help!

Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...

I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...

Is there someone here who is interested in helping out ?

The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.

Contact me on email: therseus@gmail.com

Help Loading A Random Background Full Screen
In the bottom layer of my main movie, Id like to put a random background image which loads on entering the frame and stretches to full screen. I would like to use a preloader for the image so Im trying to load a swf using this which I found here:

http://www.kirupa.com/developer/mx/l...ackground2.htm


Code:
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image0.swf");
break;
case 2 :
location.loadMovie("image0.swf");
break;
case 3 :
location.loadMovie("image0.swf");
break;
case 4 :
location.loadMovie("image0.swf");
break;
case 5 :
location.loadMovie("image0.swf");
break;
}
but I could not get it to stretch full screen. How do I get the externally loaded swf to stretch full screen and be able to resize via a listener from within my main movie?

Thanks!
Rich

Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...

I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...

Is there someone here who is interested in helping out ?

The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.

Contact me on email: therseus@gmail.com

Loading SWF On Background Image?
Hello all,

I need to have a photo slideshow play on the home page of a resort site, but I'm afraid the content will be heavy and I don't want to show the preloader.

Is there a way to have a background image in a table and then load the SWF on top of it? Does this involve DHTML layers?

Thanks in advance!
Robert

Background Image Loading Timer
Here it goes : I have a 4 x 3 grid which contains 8 MC's with images (jpg's). The 4 remainder grids cells are buttons. So here's the tricky part for which I need some help

Each of the 8 'image' cells needs to hold 8 different images (total of 64 images) which I load from the server. Each button action will trigger two 'image' cells to bring up a new image but in random. How do you call up a random image in the specific MC using AS ?

Thanks,
Smalco

Help Loading Image Background As MC /multiple MC's
Hello.This is really a two question post . but the first quesion is more important.
1. I am using this code to load a background.
photoclip.loadMovie("stripes.jpg");

I have an empty movie clip on stage. I have given it the instance name photoclip. It is positioned in the upperleft hand corner.
The issue is that the background appears but the only partially.
how do I load a background dynamically and get the full dimensions of the image to show up? Also are there ways to tile backgrounds like you can do in CSS?

2. Ideally I'd like to have a whole bunch of empty movie clips and load images into them. Is it possible to have multiple Movie clips on the stage that are different instances of the same object? I want each of these movie clips to load different images. I know i could just put the image in the MC but I think loading trthem dynamically will make for a smaller flash file.


I am using flash 8 and have very limited experience.
Thanks in advance,

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Help On Loading Background Image From Css In Flash 8
i need help on how to load a background image from a css to flash 8...HELP!!!can someone please show me step by step and the codes that i need to do...

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...

http://img219.imageshack.us/my.php?i...utmovieof5.swf

Loading Of Background Image From CSS To Flash 8
Hiya, I need to load background image from css to flash 8. Is this possible and if possible, how am I going to do it? Can anyone pls help me and greatly appreciated if u could show me the actionscript on how to do it. Thanks alot!

Loading Background Image OnMouseOver, Etc.
I'm try to solve this problem, but it seems too dificult for me... So, any help or clue are welcome!

Let me decsribe it!


I have movie that has two different images... When the movie is loaded and reach the end, I have large button that onMouseOver effect has new image (smiling girl).

The problem is that I want her to smile all the time while the mouse is over animation. That should includes the case when someone trys to type something and finally press small button to submit data. But when mouse cursor is not rolling over she should stop smiling...

The problem is that it's simple to have her smiling in every other case, but when the event as described occurs, she stop simling..

I try several solutions that came up in my head, such as attachMovie, createEmptyClip, different depths, rollOver/out etc, but it seems that I haven't bright idea what i should do i order to get the expected result.

So, please help me! It's pretty urgent...


http://img219.imageshack.us/my.php?i...utmovieof5.swf

Random Image Loading
hi there,
im trying to figure out/ write a script, so that everytime a user were to hit refresh, the swf would display a different image.

im assuming i would have to select a number by using random(5)
and then associate that number to a movieclip or scene.

if anyone has info or insights on how to go about this, i would really appreciate it.

an example of what i am talking about is here:
http://www.onenine.com/flash.html

thanks in advance -
jennifer

Random Image Loading
Hi, firstly what to say I tried to find the answer in other theads and forums, but no succes...
hope someone can help

I'm creating a page that every time it goes back frame 1 a new image is loaded in a empty MC. I used the following code:

pic_arr = ["dynamic/image_big_A.jpg",
"dynamic/image_big_B.jpg",
"dynamic/image_big_C.jpg",
"dynamic/image_big_D.jpg",
"dynamic/image_big_E.jpg",
"dynamic/image_big_F.jpg",
"dynamic/image_big_G.jpg",
"dynamic/image_big_H.jpg"];ranNum = random(pic_arr.length);
image.loadMovie(pic_arr[ranNum]);

It works! The PROBLEM is that it repeats itself, wich is something i would like to stop, at least not to see the last one shown again. Any suggestions?

__________________________________________________ _______________________
Thanks god for this forums, if not I wouldn't got as far anyway

Random Loading Image
Im trying to create a Dynamic slideshow that loads an image fades it out and loads another.

This is my code thus far. I can get the image to load but its not random.

Code:
function loadImages(amount:Number) {
for (var i = 0; i<amount; i++) {
var sURL:String = "images/0"+i+".jpg";
randImage = Math.floor(Math.random()*sURL.length);
holder.loadMovie(sURL);
}
}
loadImages(1);

Loading A Random Image
I need some help loading a random image into a movie clip.
I'm creating a flash presentation for my band with a script generated moving banner across the top of the presentation.
I have had help with a script which sends a movie clip in a repeating pattern from left to right on the stage. I wish to load an image into the clip with a different image into the following clip and so on.

I have attached the .fla file for someone to help me with.
This is not the presentation, just a mock up of what I'd like done.

I would really appreciate the help.

Random Image Loading
I've want to display 2 random images on the same page from a directory that has 5 images in it.

I got the random part, but I can't get the pics to load simultaneously. Can someone point out what I did wrong?


Code:
Array.prototype.pickRandomValues = function(n) {
var selected = [];
for (var i = 0; i<n; ++i) {
var r = Math.floor(Math.random()*this.length);
selected.push(this[r]);
this.splice(r, 1);
}
return selected;
};
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc");
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc copy");

Loading A Random Image
Hi all,
I refer to the tutorial on Loading a Random Background but what if I want to make my images randomly appear on top of each other on the click of a button just like the jackpot?

Random Image Loading Via XML
i'm trying to randomly load images via xml but my output window keeps saying "undefined".

can somebody help me please?


Code:
function loadXML(loaded){
if(loaded){
xmlNODE = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total;i++){
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
randomImage();
}else{
content = "file not loaded!";
}
}
xmlData =new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("bg.xml");

p = 0;
function randomImage(){
if(loaded == filesize){
p = Math.floor(Math.random() * total);
bgholder._alpha = 0;
bgholder.loadMovie(image[0], 1);
}
}

Loading Random XML Image
I've got external jpgs loading into my flash via XML the same as this:
http://www.kirupa.com/developer/mx20...togallery1.htm

However, I want the images to load randomly. So unlike the above tutorial, I want it to load a random image each time the user visits it.

Also, I do not need a next and previous button, but one single button which refreshs the movie with a new random image.

Does anyone know how adjust the actionscript/xml to do this?

thanks.

Loading Random Image
I want to make a button that loads a random image in a new window. Is this possible?

Loading A Random Image
Hi all,
I refer to the tutorial on Loading a Random Background but what if I want to make my images randomly appear on top of each other on the click of a button just like the jackpot?

Random Image Loading Via XML
i'm trying to randomly load images via xml but my output window keeps saying "undefined".

can somebody help me please?


Code:
function loadXML(loaded){
if(loaded){
xmlNODE = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total;i++){
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
randomImage();
}else{
content = "file not loaded!";
}
}
xmlData =new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("bg.xml");

p = 0;
function randomImage(){
if(loaded == filesize){
p = Math.floor(Math.random() * total);
bgholder._alpha = 0;
bgholder.loadMovie(image[0], 1);
}
}

Random Image Loading
Hi.
I'm building a Web site completely in Flash. On the home page along with some text I would like to load a random product image that is for sale. The text on the home page needs to stay the same, but the product image and product description as well as the "buy me" button need to load randomly so every time a user logs in he/she sees a different product. Any suggestions or links to tutorials would be very much appreciated. Thanks in advance.
Ivan

www.foundation-one.net

Random Dynamic Image Loading
Objective: create a movie that dynamically loads random images and changes to another image after a period of time, while having an "in-between" fade transition (between images loaded).

I'm able to dynamically and randomly load images to my flash project, and have even gone so far as to randomly choose an image from a folder. However, with random(), you have to specify the amount to be 'randomed' and if the number of images are too little, an error will occur saying it can't find the specific image.

Additionally, suppose in the future I want to add more images without messing with the Flash file, how am I going to come up with a script that's going to allow flash to find the images? Coz at this moment if I don't alter the flash file by adding the number of images, then it won't find the new images.

-oxy

Dynamically Loading A Random Image
I'm sure this is really easy and I'm going to kick myself when someone shows me but I've got out of practice with Flash (not that i was a master or anything in the first place).

Basically I am trying to dynamically load one of three images, selected at random, into a movieclip when a button is pressed.

I think it should be something like this:

button1_btn.onRelease = function() {
randNum += random(3);
loadMovie("images/[randNum].jpg", box1_mc);
}

Although now of course it is looking for an image called [randNum].jpg - rather than using randNum to select an image. Where am I going wrong?

thanks for your help

Naomi

Help With Random Image Loading Script :(
I am trying to make a random image loading script .. the catch is that i want to read the url from text file

concept is that a screen will be showing different names of games and when a game is highlighted its screen shots will be displayed, now screen shots url would be picked from the text file called path.txt

path.txt would be something like

&game1a=c:picsabc1.jpg
&game1b=c:picsabc2.jpg
&game1c=c:picsabc3.jpg
&game2a=c:picsdef1.jpg
&game2b=c:picsdef2.jpg
&game2c=c:picsdef3.jpg

now i want to read one variable at a time and load that image for around 3 seconds and than load the other one and so on ..

i can easily import text files and read from them but when i try using them nothing happens for instance i made a text file called test.txt which had

&myText=1

i did

myData = new LoadVars();
myData.load("test.txt");

now i can read that data in a dynamic text field but when i try to use the value in loading image like

loadMovie ( myData.myText + ".jpg",image);

image does not loads

but when i do

a = 1;
loadMovie ( a + ".jpg",image);

image loads up

when i try assigning value to some other variable like

a = myText;
or
a = myData.myText;

still nothing happens

can someone tell me where i am going wrong here?

Loading A Random Image Help Needed
Im trying to create a Dynamic slideshow that loads an image fades it out and loads another.

This is my code thus far. I can get the image to load but its not random.

Code:
function loadImages(amount:Number) {
for (var i = 0; i<amount; i++) {
var sURL:String = "images/0"+i+".jpg";
randImage = Math.floor(Math.random()*sURL.length);
holder.loadMovie(sURL);
}
}
loadImages(1);

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