Page 1 of 1

Random page in flash tease?

Posted: Wed Jun 05, 2013 3:47 am
by kinkyman12
OK, long story short:
I am creating a flash tease. It is my first one. I am used to the visual editor, however, my script writing skills are slim to none. Here is what I am trying to do:
Go from page A to either page B1 or to page B2. I want this to be done from a countdown timer on page A. The difference between B1 and B2 is the length of time the task will take. Can anybody give me an example of how to set that up? I know how to do random pictures, so it is just a matter of getting the random page down.

Thanks in advance for your help :-)

EDIT: Not sure if this topic has been addressed or not already, so I apologize if this is a repeat. I find it hard to find answers in this forum.

Also, if it could be explained in a very basic/simple manner that would be awesome. I am an computer repair technician by trade, but my script skills are lacking.

Thanks again :-)

Re: Random page in flash tease?

Posted: Wed Jun 05, 2013 6:40 am
by philo
Random pages must be numeric
The script below should work

start#page('
<DIV>Random page after 15 seconds</DIV>',pic(""),delay(15sec,range(1,2)));
1#page('
<DIV>First Random Page</DIV>
',pic(""));
2#page('
<DIV>Second Random Page</DIV>
',pic(""));

Re: Random page in flash tease?

Posted: Wed Jun 05, 2013 7:07 am
by Nezhul
The script below should work
no it shouldn't.

The syntax of range is
range(<r1>,<r2>,'page')
where <r1> and <r2> are numbers, and <r1> is less than <r2>
range command can be used instead of target in continue button, delay or goto(). It can't be used in custom buttons or yes/no buttons.
Note that 'page' part is necessary and never changes. Also note that there should not be # sign after range command.

for example:
go(range(1,5,'page')) is a continue button that randomly selects between pages 1#, 2#, 3#, 4# and 5#. Note that for the page to be selected it should exist, and also should not be "set", i.e. visited previously or marked by set() command. must() and mustnot() constrictions also apply.
If there is no sufficien pages to go to, the command will do nothing, and the tease will freeze there.

Re: Random page in flash tease?

Posted: Mon Jun 24, 2013 3:56 am
by kinkyman12
Perhaps I am not doing it right. Here are the three pages in question:

page82#page(
'<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',
pic("picture"),
delay(10sec, go(range(page831,page832,'page')#)
);

page831#page(
'<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',
pic("picture"),
vert(buttons(page77#, "BUTTON"),delay(40sec, page84#,style:secret))
);

page832#page(
'<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',
vert(buttons(page77#, "BUTTON"),pic("picture"),
delay(3min, page84#,style:secret)
);

The 831 and 832 are for versions 1 and 2 of page 83. As you can see, the only difference is the time between the two versions of page 83. With how it is setup right now, the tease does not continue to page 831 or page 832. It just loops on page 82. If you could let me know how to set this up I would greatly appreciate it.

EDIT: I removed the # after the range command but it still loops.
EDIT AGAIN: I realized the # was placed automatically, however, is the random page able to be used in a timer?

Re: Random page in flash tease?

Posted: Mon Jun 24, 2013 6:15 am
by philo
One obvious thing is that the pages have to be numeric. So a page name of 832 will work but page832 will not.

Re: Random page in flash tease?

Posted: Mon Jun 24, 2013 1:29 pm
by Venus
You had some syntax errors in your code. I corrected it for you and marked the lines in red.

Code: Select all

page82#page('<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',pic("picture"),[color=red]delay(10sec, range(831,832,'page'))[/color]); [color=red]831#page([/color]'<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',pic("picture"),vert(buttons(page77#, "BUTTON"),delay(40sec, page84#,style:secret))); [color=red]832#page([/color]'<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="FontSans" SIZE="18" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">Page Text Here</FONT></P></TEXTFORMAT>',vert(buttons(page77#, "BUTTON"),pic("picture"),delay(3min, page84#,style:secret));

Re: Random page in flash tease?

Posted: Tue Jun 25, 2013 4:10 am
by kinkyman12
Cool! Got it! Thanks for all your help guys! The corrections suggested by Venus solved the problem. I will also make a note for myself that the range can only be numeric. I was not aware of this. I will certainly be using this range command in future teases :-D