View Full Version : dynamic image slider
shakesula
07-07-2004, 07:52 PM
I have a client that wants an image scroller, and they want the ability to upload new images without altering the flash file.
I was looking at this image scroller, and I'm guessing its probably dynamic:
http://www.expressfashion.com/style/casual_scene/looks_m.jsp?navid=1.1.2.2.1.0
Would it be possible to build a scroller like this one that would be dynamic, and if so, how would i script that?
of course itīs possible... :D
script what? the server side php scripts or the scrolling?
cobo
pdechery
07-12-2004, 07:47 PM
Hi,
Am I lucky or what? This thread matches perfectly with what I was desesperatly trying to achieve, with no sucess...
Cobo, could you please explain us something about the (action) scripting that make possible to those images be replaced dinamically?
Thanks,
Pierre
if you are pulling the images out of a database you have to code a php wich output the links with echo();
it should look something like: pic1=http://www.yourdomain.com/yourPic1.jpg&pic2=http://www.yourdomain.com/yourPic2.jpg... and so on
in flash you just create an instance of a loadVars Object and parse all the data...
thats it... ;)
cobo
pdechery
07-12-2004, 08:28 PM
Cobo,
Thanks a lot. Actually I already got the php (made by the programming team who I work with), but Iīm stuck with the AS part. Thatīs a little to far from my level in it right now.
But I still would like to understand a little more of it, and if you could go a little deeper and explain that ActionScript for all of us, would be great.
Thanks,
Pierre
hi,
the loadVars Object is very well explained at flashīs intern help function (press F1).
after the object has loaded all data into flash itīs easy to call the different variables...
they will be called with the objects name, for example:
_root.yourLoadVars.yourVariable
at the php file you have to give each variable a kind of index, as i said before: pic1=...&pic2=...&pic3=... and so on
you will also need a variable wich tells you how many entrys exist.
maybe: allDataSend=7
you just have to create a tile with needed information from the db and attach this at runtime, incrementing the data with the index... ;)
cobo
pdechery
07-13-2004, 02:23 PM
Cobo,
Thanks a lot again.
I will now carefully read the LoadVars explanation in the help file, like you told. I still donīt get how how a variable turns itself into an image in Flash, but I hope that become clearer soon.
Until the end of the day Iīll be posting here something and I hope this thread continue till I had learned something! It will be a huge step for me.
Thanks,
Pierre
pdechery
07-13-2004, 02:27 PM
By the way, anyone know where to find a tutorial abou that scrolling mentioned in the first message in this thread? That is a nice effect, though a little overused.
I still donīt get how how a variable turns itself into an image in Flash, but I hope that become clearer soon.
well a variable never turns into something else then a variable... but a variable could contain a link to an image on your server... ;)
flash will load the picture dynamicly - that means directly from your pic folder on your host...
cobo
pdechery
07-15-2004, 05:23 PM
Cobo,
Sorry for the late posting, but I was busy fixing some html and could not drive my attention to Action Script;
Thing is, this (http://www.cta-rj.com.br:8080/villa/portal/index.php) is my project. I hope you can take a look. The little animation on the bottom is where I need to have the images loaded from the database through variables.
I read the LoadVars help and understand a little of it, but I donīt know yet how to make my graphics be replaced by variables, or wathever is the name of that process! :) Can you please help me? I got the flaīs and everything...
Thanks,
Pierre
well... this is a place for people who wants to learn, to show them the right direction... (i know youīre willing to learn).
Itīs just that I usualy donīt have the time to do other peoples work (Iīm busy at my own projects), but if you post your fla i will have a look at it... ;)
cobo
pdechery
07-16-2004, 09:27 PM
Cobo,
Thanks a lot for you support here! I hope that you didnīt get me wrong when I offered my flaīs. Maybe I had been a little abusive, wich is not what I want to be.
Well, actually I think that if I just gave the flaīs to you, and get you to do what I coulnīt do myself (supposing you wanted to do that), it would be a little abusive from me, and I would not learn anything (too bad :( ). But at the other way I really would like to learn how to solve that damn thread! So, maybe you could tell me if there is some kind of tutorial about this subject?
But I appreciate your support so far! Thank you!
Pierre
hi...
the code in flash should look similar to this:
stop();
_root.yourLoadVars = new LoadVars(); //create a new loadVars instance
_root.yourLoadVars.load("http://www.yourDomain.com/yourSubdirectory/yourPhpFile.php"); //to Load the data...
_root.yourLoadVars.onLoad = function (success) {
if (success) {
gotoAndPlay(2); //or whatever frame you like
} else {
}
}
afterwards you address the data with _root.yourLoadVars.yourVariable
cobo
Iīm sorry but I donīt know tuts for that kind of thing... i also had learned it by trial and error... ;)
cobo
pdechery
07-17-2004, 05:29 PM
I... i also had learned it by trial and error... ;) cobo
Well, I guess Iīm going to do the same! ;) Which means Iīm going to spend some time trying to use and understand your code. Iīll come up here again soon to tell you if I suceeded!
And thanks a lot!
Pierre
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.