Avatar billede morphman Nybegynder
16. september 2008 - 15:47 Der er 3 kommentarer

Flash Banner rotator

Hi there, I just wanna ask for some help with a little thing I am trying to make. I hope that you can help me out here.
I need to make a flash file can is gonna be used to show three dirrerent  flash files in a random order.
It should also be able to show an image instead of a flash file.

There can be three files but no more than that. The flash files are all of the same size.

I had an idea to create one flash file which takes a FlashVars because everything needs to be dynamic.

Well, that is all... hope you can help me out.

Thanks
Avatar billede Slettet bruger
16. september 2008 - 16:23 #1
You can make a flash file, and so from your site make a variable there tells which images/flash file it should load.
In this flash file can you so revice them variable and load the image/flash file into it.

Hope you understand, and you need help to make it, or just the way to make it?
Avatar billede morphman Nybegynder
17. september 2008 - 09:51 #2
I need a little help to actually make it work. I have made a file that get FlashVars. I am sending vars as such.

file1=ext1.swf&file2=ext2.swf&file3=ext3.swf

Now what I have to do is get them to rotate in flash plus if as to start in a random order and that is where I am lost.
Avatar billede morphman Nybegynder
17. september 2008 - 11:39 #3
I cooked up something... at least what I think it would do. It would be great if one of you could check it for me and perhaps optimize it a little. Plus is it possible to fade a new file in and out? If so can you help? Thanks again :)

var curcount:Number = Math.floor(Math.random() * (3 - 1) + 1);;
var maxcount:Number = 3;

files = new Array(file1,file2,file3);
delay = new Array(time1,time2,time3);

movieloader(files[curcount]);

var si:Number = setInterval(function ()
{
    if(curcount == maxcount){
        curcount = 0;
    }

    movieloader(files[curcount]);
   
    (curcount >= maxcount) ? clearInterval(si) : curcount++;

}, delay[curcount]);



function movieloader(file){
    trace (file);
   
    var myLoader:MovieClipLoader = new MovieClipLoader();
    myLoader.loadClip(file, myContainer);
}
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester