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 03-14-2007, 09:13 PM   PM User | #1
Ulysses
New Coder

 
Join Date: Apr 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Ulysses is on a distinguished road
Question How to stop a rotator looping ?

Hi all. I have a Flash picture rotator that works well, but keeps looping forever. I want it to show each picture once, and then stop.

The rotator comprises three files:
1) index.swf
2) index.html
3) settings.xml

The index.html contains the following:
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="index" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="index.swf" />
<!--<param name="loop" value="false" /> -->
<param name="quality" value="best" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="#ffffff" />
<embed src="index.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="100%" height="100%" name="index" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
The settings.xml file looks like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<options>

<!-- SET THE NUMBER OF PHOTOS -->

<PHOTOSNUMBER>
      <imageName>images/slides/01</imageName>
      <imageName>images/slides/02</imageName>
      <imageName>images/slides/03</imageName>
</PHOTOSNUMBER>

<TIME>
<!-- CHOOSE THE TIME IN SECONDS A IMAGE STAYS ON SCREEN - DEFAULT IS 5 SECONDS -->
      <time>2</time>             

<!-- CHOOSE THE ALPHA SPEED -->  
      <alpha>3</alpha>

<!-- CHOOSE IF TO DISPLAY THE PICTURES IN A RANDOM ORDER --> 
      <random>false</random>   	  
</TIME>

</options>
I have an FLA for the SWF but have not a clue what to do with it! Anyway, here it is.

I tried <param name="loop" value="false" /> in the html but it didn't work.

Does anyone know how I can make it show the set of pictures once and then stop?

Thanks
Ulysses is offline   Reply With Quote
Old 03-15-2007, 02:16 AM   PM User | #2
db2six9
New Coder

 
Join Date: Feb 2007
Location: Austin
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
db2six9 is an unknown quantity at this point
I was unable to view the swf, but unless there is a lot of information not included in the file I downloaded, your script is awfully complicated for what you have. Could you load this so I can view it online, or explain what you are trying to show.

Generally you should be able to simply ad a stop action to your timeline on the last frame you want to show, or if it is all done in action script you would ad this where you want it to stop.

The HTML will not affect the swf (correct me if I am wrong) as it is created from the actyal fla file.
db2six9 is offline   Reply With Quote
Old 03-15-2007, 02:39 AM   PM User | #3
Ulysses
New Coder

 
Join Date: Apr 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Ulysses is on a distinguished road
Hi db2six9,

The demo page is at http://reneeshouseofdesigns.com.au/demo.html

and the SWF is at http://reneeshouseofdesigns.com.au/index.swf

I did have a look at it but it was way too complex for my level of knowledge.
I've been using this rotator on sites for a while now, and someone did say it might be a bit out of date. Maybe t's time to find a fresh new (simpler) rotator?

Thanks for looking at it.
Ulysses is offline   Reply With Quote
Old 03-16-2007, 03:47 PM   PM User | #4
db2six9
New Coder

 
Join Date: Feb 2007
Location: Austin
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
db2six9 is an unknown quantity at this point
ok, ya now I see what you got goin.

The action script you are using for this is acceptable, there a easier ways to create it, including creating a swf with a timeline, but action script is cleaner. Ultimatly all you need to do is specify when you load the clip how long to delay, and how many times to loop. You should have some sort of load clip action in your sequence somewhere, when you add that, give it delay time and looping number. The script should look something like this.

loadMovie.("SlideShow.swf" "0" "1")

This is not exactly correct, but the 0 is going to be your delay in ms and the 1 is the number times the loaded clip will loop. This also works with music, animations or anything else you will be loading dynamicly or from your library.
db2six9 is offline   Reply With Quote
Old 03-16-2007, 11:47 PM   PM User | #5
Ulysses
New Coder

 
Join Date: Apr 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Ulysses is on a distinguished road
Quote:
Originally Posted by db2six9 View Post
.....You should have some sort of load clip action in your sequence somewhere, when you add that, give it delay time and looping number. The script should look something like this.

loadMovie.("SlideShow.swf" "0" "1")

This is not exactly correct, but the 0 is going to be your delay in ms and the 1 is the number times the loaded clip will loop. This also works with music, animations or anything else you will be loading dynamicly or from your library.
Thanks. The delay dime is ok, as it is already determined in the settings.xml file with <time>2</time> which in this case shows each image for 2 seconds.

Can I just specify not to loop somehow? Also where actually should that line of code go? Or, is there a way of conrolling loop in the settings.xml file with (say) <loop>0</loop> - or is that too simple to be practical?

Thanks for your help.
Ulysses is offline   Reply With Quote
Old 03-17-2007, 07:57 AM   PM User | #6
db2six9
New Coder

 
Join Date: Feb 2007
Location: Austin
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
db2six9 is an unknown quantity at this point
are you loading this clip dynamically? Is the make of the majoraty of this page html/CSS or is it all done if flash?

If the first is true, you will need to go into the actuall .fla file to put a stop action on the last frame of your timeline, or a stop action after the last image is loaded in your actionscript. This will depend on whether or not the images are loaded in a timeline or if they are stored in the library or in an external folder.

The second, that is if this whole page is created in flash, then you will be loading the slide show thru action script, and that is where you will be putting the timeline controlls

About the dalay, if you do not want any delay simply place a "0" in its place. You have to place a digit as the action script will be expecting one and the script will not be valid without it.

Check out this slide show, it was created simply (lazy) with a handfull of images, a white box with an alpha tween (transparency fade) and verry little action script. If you are just beginning and want to create your own slide show with several images that will not be changed out often I would recomment trying this route.

http://whcfa.org/Drew/JC/Master.swf
db2six9 is offline   Reply With Quote
Old 03-17-2007, 09:23 AM   PM User | #7
Ulysses
New Coder

 
Join Date: Apr 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Ulysses is on a distinguished road
Quote:
Originally Posted by db2six9 View Post
are you loading this clip dynamically? Is the make of the majoraty of this page html/CSS or is it all done if flash?

If the first is true, you will need to go into the actuall .fla file to put a stop action on the last frame of your timeline, or a stop action after the last image is loaded in your actionscript. This will depend on whether or not the images are loaded in a timeline or if they are stored in the library or in an external folder.

The second, that is if this whole page is created in flash, then you will be loading the slide show thru action script, and that is where you will be putting the timeline controlls

About the dalay, if you do not want any delay simply place a "0" in its place. You have to place a digit as the action script will be expecting one and the script will not be valid without it.

Check out this slide show, it was created simply (lazy) with a handfull of images, a white box with an alpha tween (transparency fade) and verry little action script. If you are just beginning and want to create your own slide show with several images that will not be changed out often I would recomment trying this route.

http://whcfa.org/Drew/JC/Master.swf
I don't think we're on the same page here. The rotator I have explained uses a settings.xml file to locate the images, the number of images, the time the image stays on screen, the alpha speed and the picture order. To change the delay, I simply change the number within <time>2</time> in the settings.xml

The only thing I want to change with this is for it to only show each picture once.

Maybe another way of putting the question is: What needs to be done (and how) to the index.swf (via index.fla) so that the mandatory loop becomes an option controlled by the settings.xml file with (say) <loop>0</loop> line in it?

Hope that explains it a bit better.
Ulysses is offline   Reply With Quote
Old 03-24-2007, 12:06 PM   PM User | #8
Ulysses
New Coder

 
Join Date: Apr 2006
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Ulysses is on a distinguished road
Solution found. I simply wiped it with a cheque book, and built a new one in 15 minutes!

Thanks to http://www.amarasoftware.com/flash-slide-show.htm
Ulysses 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 04:36 PM.


Advertisement
Log in to turn off these ads.