Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2008, 01:44 PM   PM User | #1
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
image transition

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.
j05hr is offline   Reply With Quote
Old 11-06-2008, 03:47 PM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.

Code:
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.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-06-2008, 06:31 PM   PM User | #3
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
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?
j05hr is offline   Reply With Quote
Old 11-06-2008, 07:16 PM   PM User | #4
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-06-2008, 07:33 PM   PM User | #5
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
on that example it stops at 4 where i would want it to back to 1?
j05hr is offline   Reply With Quote
Old 11-06-2008, 08:05 PM   PM User | #6
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-07-2008, 01:02 AM   PM User | #7
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
Thanks, i'll do the pictures in the morning and then report back.

Last edited by j05hr; 11-07-2008 at 02:28 AM..
j05hr is offline   Reply With Quote
Old 11-10-2008, 11:23 AM   PM User | #8
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
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?
j05hr is offline   Reply With Quote
Old 11-10-2008, 05:14 PM   PM User | #9
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
You need the XML2Object script that it talks about, follow that link and add that to flash first.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-26-2008, 09:41 AM   PM User | #10
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
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
j05hr is offline   Reply With Quote
Old 11-26-2008, 09:46 AM   PM User | #11
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-26-2008, 09:58 AM   PM User | #12
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
is this the right code that i should be adding for it?

Code:
/**
* 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)
}
j05hr is offline   Reply With Quote
Old 11-26-2008, 12:35 PM   PM User | #13
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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?
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-26-2008, 01:50 PM   PM User | #14
j05hr
Regular Coder

 
Join Date: Nov 2008
Posts: 175
Thanks: 4
Thanked 6 Times in 6 Posts
j05hr is an unknown quantity at this point
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-...nload-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.
j05hr is offline   Reply With Quote
Old 11-26-2008, 02:08 PM   PM User | #15
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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!
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:25 PM.


Advertisement
Log in to turn off these ads.