View Full Version : image transition
j05hr
11-06-2008, 01:44 PM
So i have an image transition on my site. When you go on the site, it jaggers and sort of lags, is there a way to fix this or is it because the file is too big or something?
Also the last image in the transition (the only black and white one) doesn't restart from the beginning how i want it to. Is there something i can do on the timeline or some actionscript i can use to make it rotate like the rest of the images?
You can view the transition at www.jasongold.org
Thanks in advance for any help.
gnomeontherun
11-06-2008, 03:47 PM
You can have it restart by putting this code in the actions panel on the last frame which will restart the flash file from the start. I don't think this is the issue though.
gotoAndPlay(1);
How did you make the player, and how large are the images? The SWF is 224 kb, which is a bit large to load over slower connections. But after it is loaded it runs normally.
Maybe a solution is to have it setup as an XML image gallery, so the images are not directly embedded in the SWF.
j05hr
11-06-2008, 06:31 PM
I'll try the code later although i don't think it will solve the case either, what i want it to do is carry on playing from the beginning as if it hasn't got to the end?
I'm not sure of the size of the images as i haven't got them at the moment with me. I made the player by using motion tween to fade images in and out overlapping each other using the alpha color function.
How would i go about loading it as an XML rather than embedded?
gnomeontherun
11-06-2008, 07:16 PM
http://www.theorigin.net/view_post/111.html Here is an example. If you do this, you will be starting with a new file anyways.
j05hr
11-06-2008, 07:33 PM
on that example it stops at 4 where i would want it to back to 1?
gnomeontherun
11-06-2008, 08:05 PM
Once you have it working, I can help add the missing code to repeat. It basically just requires to modify so that it resets the counter and starts again.
j05hr
11-07-2008, 01:02 AM
Thanks, i'll do the pictures in the morning and then report back.
j05hr
11-10-2008, 11:23 AM
i've been looking at this this morning. I downloaded the zip version but the images don't load when i go to view it. Is there something i need to change or is it just broken?
gnomeontherun
11-10-2008, 05:14 PM
You need the XML2Object script that it talks about, follow that link and add that to flash first.
j05hr
11-26-2008, 09:41 AM
this confuses me soo much, would it be possible to break it down into exactly what i need for example
in the xml i need...
in the .fla i need...
i downloaded the XML2Object script and no idea how to use/where to put it
thanks for the help
gnomeontherun
11-26-2008, 09:46 AM
You have to add it using the Extension Manager by Macromedia or Adobe, depending on which version you have. So open the Extension Manager, Add it, and then the code should function.
j05hr
11-26-2008, 09:58 AM
is this the right code that i should be adding for it?
/**
* How to use the XML2Object class
* in order to convert XML files into
* AS native objects
*/
// import the class. you need to install first
// the .mxp file provided with the zip, using the
// Macromedia Extension Manager
import it.sephiroth.XML2Object
// xml file for the test
xmlFile = "./test.xml"
// now load the XML using the classic
// XML class
myXML = new XML();
myXML.load(xmlFile);
myXML.onLoad = function(){
trace("XML loaded");
// now initialize the XML2Object class
var xml_loader:XML2Object = new XML2Object();
// get the native flash object using the parseXML method, and
// passing the XML itself as argument
as2obj = xml_loader.parseXML(this);
// let's parse the Object now...
// if a node is multiple it will be traslated as an Array, like the
// IMAGE tag of the XML file
trace("Image 1: " add as2obj.MAIN.IMAGE[0].data add ", with ID: " add as2obj.MAIN.IMAGE[0].attributes.id)
trace("Image 2: " add as2obj.MAIN.IMAGE[1].data add ", with ID: " add as2obj.MAIN.IMAGE[1].attributes.id)
// some other tag
trace("TEXT: ")
trace(as2obj.MAIN.TEXT.ID.data)
trace(as2obj.MAIN.TEXT.ALT[0].data)
trace(as2obj.MAIN.TEXT.ALT[1].data)
}/**
* How to use the XML2Object class
* in order to convert XML files into
* AS native objects
*/
// import the class. you need to install first
// the .mxp file provided with the zip, using the
// Macromedia Extension Manager
import it.sephiroth.XML2Object
// xml file for the test
xmlFile = "./test.xml"
// now load the XML using the classic
// XML class
myXML = new XML();
myXML.load(xmlFile);
myXML.onLoad = function(){
trace("XML loaded");
// now initialize the XML2Object class
var xml_loader:XML2Object = new XML2Object();
// get the native flash object using the parseXML method, and
// passing the XML itself as argument
as2obj = xml_loader.parseXML(this);
// let's parse the Object now...
// if a node is multiple it will be traslated as an Array, like the
// IMAGE tag of the XML file
trace("Image 1: " add as2obj.MAIN.IMAGE[0].data add ", with ID: " add as2obj.MAIN.IMAGE[0].attributes.id)
trace("Image 2: " add as2obj.MAIN.IMAGE[1].data add ", with ID: " add as2obj.MAIN.IMAGE[1].attributes.id)
// some other tag
trace("TEXT: ")
trace(as2obj.MAIN.TEXT.ID.data)
trace(as2obj.MAIN.TEXT.ALT[0].data)
trace(as2obj.MAIN.TEXT.ALT[1].data)
}
gnomeontherun
11-26-2008, 12:35 PM
Yes, assuming that you also installed the extension like I described, that should be the method of importing the library for use. Does it function?
j05hr
11-26-2008, 01:50 PM
I installed the exstension but didn't really play with it enough as i found another one that seems to work ok (www.jasongold.org) I do want to have a proper go at yours when i finish the project and get some free time as this whole process is all about learning.
I now would like to make my gallery an xml file so my client will be able to add photos himself. Do you know of any tutorials of a gallery like this (http://www.softsia.com/FlexiGallery-XML-Flash-Image-Gallery-download-wbkt.htm)
So i can learn how to do something along the same lines. The gallery has to have thumbnails. Have a slider on the thumnails and not play automatically.
Thanks a lot for all your help.
gnomeontherun
11-26-2008, 02:08 PM
There are many out there, and honestly I don't know which are best. There is a link in my signature to good sites, and things on the site are likely to be good quality (which some things you find via Google might not). That way you find a tutorial that you feel comfortable tackling instead of one that I post which may not be exactly what you need.
As always, if you struggle you can post!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.