Ask a Question related to Macromedia Flash Sitedesign, Design and Development.
-
-
Can a film loop play once, then loop on the last frame(s)?
I need a film loop to play once, then loop playback on the last frame so I can keep the LOOP of the film loop set. This will allow the tell commands... -
Film loop rollovers working with tell sprite, but only if Loop is checked
on mouseWithin me cursor 280 tell sprite 40 --the sprite containing the film loop sprite(60).member = member("networkmapsbuttonroll") --swapping... -
newbie stuck in a loop de loop
Hi all, thanks in advance for any help... what I want to do is: 1) read in a file containing daily total hits to certain urls within a... -
Urgent: Repeat loop and Film loop clash!
Hi All, Scenario I have a script running in which the spelling which was typed in by the student is corrected. The alphabets are moved to... -
Help with loop inside loop and mysql queries
Hi List. I cannot see my error: I have relation tables setup. main id entity_name main_type etc etc date_in 1 test type1 x y 2003-06-02... -
Brian #2
Loop
Hi,
Total newb here so my apologies if I break any scripting standards. I
have some code that pulls reservation times from a database. It is
supposed to print green cells in a table until the time of the
reservation and then print red cells until the reserved period has
ended and then continue printing green cells. Example: reservation
period is 11:00 AM to 2:00 PM. Print green cells until representing
every half hour until 11. Print red cells until 2 then print green
cells until end of day(7 PM). I ran into a problem and statically
assigned values to take the DB out of the loop. Below is the code. Can
anyone tell me why is it that if the reservation start time is before
9:30 AM that the loop breaks and doesn't print red cells. Sorry for
being lengthy,...
Brian
<%
vtime = TimeValue(#7:00#)
btime = TimeValue(#9:30#)
Response.Write "<table border=1>"
For i = 1 to 30
If vtime > btime AND vtime < TimeValue(#12:31#) Then
Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 5) & "</td>"
vtime = DateAdd("n", 30, vtime)
Else
Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 4) & "</td>"
vtime = DateAdd("n", 30, vtime)
End If
Next
Response.Write "</tr>"
vtime = TimeValue(#7:00#)
stime = TimeValue(#8:00#)
btime = TimeValue(#9:30#)
etime = TimeValue(#11:00#)
Response.Write "<tr height=20>"
Do while Left(vtime, 4) <> Left(stime, 4)
Response.Write "<td bgcolor='#3CB371'></td>"
vtime = DateAdd("n", 30, vtime)
Loop
Do while Left(vtime, 4) <= Left(etime, 5)
Response.Write "<td bgcolor='#F08080'></td>"
vtime = DateAdd("n", 30, vtime)
Loop
Response.Write "</table>"
%>
Brian Guest
-
Chris Hohmann #3
Re: Loop
"Brian" <slider@capecod.net> wrote in message
news:69156115.0310060541.2824e6f2@posting.google.c om...By using the Left function, your comparing string values not time> Hi,
>
> Total newb here so my apologies if I break any scripting standards. I
> have some code that pulls reservation times from a database. It is
> supposed to print green cells in a table until the time of the
> reservation and then print red cells until the reserved period has
> ended and then continue printing green cells. Example: reservation
> period is 11:00 AM to 2:00 PM. Print green cells until representing
> every half hour until 11. Print red cells until 2 then print green
> cells until end of day(7 PM). I ran into a problem and statically
> assigned values to take the DB out of the loop. Below is the code. Can
> anyone tell me why is it that if the reservation start time is before
> 9:30 AM that the loop breaks and doesn't print red cells. Sorry for
> being lengthy,...
>
> Brian
>
>
> <%
>
> vtime = TimeValue(#7:00#)
> btime = TimeValue(#9:30#)
>
>
> Response.Write "<table border=1>"
>
> For i = 1 to 30
>
> If vtime > btime AND vtime < TimeValue(#12:31#) Then
> Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 5) & "</td>"
> vtime = DateAdd("n", 30, vtime)
>
> Else
>
> Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 4) & "</td>"
> vtime = DateAdd("n", 30, vtime)
>
> End If
> Next
> Response.Write "</tr>"
>
>
> vtime = TimeValue(#7:00#)
> stime = TimeValue(#8:00#)
> btime = TimeValue(#9:30#)
> etime = TimeValue(#11:00#)
>
> Response.Write "<tr height=20>"
>
>
>
> Do while Left(vtime, 4) <> Left(stime, 4)
>
> Response.Write "<td bgcolor='#3CB371'></td>"
>
> vtime = DateAdd("n", 30, vtime)
>
>
>
> Loop
>
>
>
> Do while Left(vtime, 4) <= Left(etime, 5)
>
> Response.Write "<td bgcolor='#F08080'></td>"
>
> vtime = DateAdd("n", 30, vtime)
>
> Loop
>
>
>
>
>
>
>
>
>
> Response.Write "</table>"
>
> %>
values. As such, lexically (alphabetically), "8:00" occurs after
"11:00". Here's some revised code for your review:
<%
Dim d,s,e,i
s = #11:00:00#
e = #14:00:00#
With Response
.Write "<table border='1'>"
.Write "<tr>"
For i = 14 To 35
d = DateAdd("n",i*30,0)
.Write "<td bgcolor='F0E68C'>"
.Write FormatDateTime(d,vbShortTime)
.Write "</td>"
Next
.Write "</tr>"
.Write "<tr>"
For i = 14 To 35
d = DateAdd("n",i*30,0)
If (e > d) And (s < DateAdd("n",30,d)) Then
.Write "<td bgcolor='#F08080'> </td>"
Else
.Write "<td bgcolor='#3CB371'> </td>"
End If
Next
.Write "</tr>"
.Write "</table>"
End With
%>
Notes:
1. Consider using ISO-8601 standard date/time formats (yyyy-mm-dd
hh:nn:ss)
2. Consider using a browser-safe color palette.
3. Refer to the following article for advice on formatting date/time
values. aspfaq.com/2313
HTH
-Chris Hohmann
Chris Hohmann Guest
-
Brian #4
Re: Loop
"Chris Hohmann" <hohmannATyahooDOTcom> wrote in message news:<ubxQpqCjDHA.2768@TK2MSFTNGP10.phx.gbl>...
Yes, that helps a lot. It makes sense now. Thank you.> "Brian" <slider@capecod.net> wrote in message
> news:69156115.0310060541.2824e6f2@posting.google.c om...>> > Hi,
> >
> > Total newb here so my apologies if I break any scripting standards. I
> > have some code that pulls reservation times from a database. It is
> > supposed to print green cells in a table until the time of the
> > reservation and then print red cells until the reserved period has
> > ended and then continue printing green cells. Example: reservation
> > period is 11:00 AM to 2:00 PM. Print green cells until representing
> > every half hour until 11. Print red cells until 2 then print green
> > cells until end of day(7 PM). I ran into a problem and statically
> > assigned values to take the DB out of the loop. Below is the code. Can
> > anyone tell me why is it that if the reservation start time is before
> > 9:30 AM that the loop breaks and doesn't print red cells. Sorry for
> > being lengthy,...
> >
> > Brian
> >
> >
> > <%
> >
> > vtime = TimeValue(#7:00#)
> > btime = TimeValue(#9:30#)
> >
> >
> > Response.Write "<table border=1>"
> >
> > For i = 1 to 30
> >
> > If vtime > btime AND vtime < TimeValue(#12:31#) Then
> > Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 5) & "</td>"
> > vtime = DateAdd("n", 30, vtime)
> >
> > Else
> >
> > Response.Write "<td bgcolor='#F0E68C'>" & Left(vtime, 4) & "</td>"
> > vtime = DateAdd("n", 30, vtime)
> >
> > End If
> > Next
> > Response.Write "</tr>"
> >
> >
> > vtime = TimeValue(#7:00#)
> > stime = TimeValue(#8:00#)
> > btime = TimeValue(#9:30#)
> > etime = TimeValue(#11:00#)
> >
> > Response.Write "<tr height=20>"
> >
> >
> >
> > Do while Left(vtime, 4) <> Left(stime, 4)
> >
> > Response.Write "<td bgcolor='#3CB371'></td>"
> >
> > vtime = DateAdd("n", 30, vtime)
> >
> >
> >
> > Loop
> >
> >
> >
> > Do while Left(vtime, 4) <= Left(etime, 5)
> >
> > Response.Write "<td bgcolor='#F08080'></td>"
> >
> > vtime = DateAdd("n", 30, vtime)
> >
> > Loop
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Response.Write "</table>"
> >
> > %>
> By using the Left function, your comparing string values not time
> values. As such, lexically (alphabetically), "8:00" occurs after
> "11:00". Here's some revised code for your review:
>
> <%
> Dim d,s,e,i
> s = #11:00:00#
> e = #14:00:00#
>
> With Response
> .Write "<table border='1'>"
> .Write "<tr>"
> For i = 14 To 35
> d = DateAdd("n",i*30,0)
> .Write "<td bgcolor='F0E68C'>"
> .Write FormatDateTime(d,vbShortTime)
> .Write "</td>"
> Next
> .Write "</tr>"
>
> .Write "<tr>"
> For i = 14 To 35
> d = DateAdd("n",i*30,0)
> If (e > d) And (s < DateAdd("n",30,d)) Then
> .Write "<td bgcolor='#F08080'> </td>"
> Else
> .Write "<td bgcolor='#3CB371'> </td>"
> End If
> Next
> .Write "</tr>"
> .Write "</table>"
> End With
> %>
>
> Notes:
> 1. Consider using ISO-8601 standard date/time formats (yyyy-mm-dd
> hh:nn:ss)
> 2. Consider using a browser-safe color palette.
> 3. Refer to the following article for advice on formatting date/time
> values. aspfaq.com/2313
>
> HTH
> -Chris Hohmann
Just curious, why do you say that I should consider using a
browser-safe color palette?
Brian
Brian Guest
-
Chris Hohmann #5
Re: Loop
"Brian" <slider@capecod.net> wrote in message
news:69156115.0310070544.2122a1ac@posting.google.c om...Force of habit mainly. :) It's really not that much of an issue anymore.> Yes, that helps a lot. It makes sense now. Thank you.
> Just curious, why do you say that I should consider using a
> browser-safe color palette?
Here are some points:
1. Some miniscule fraction of your user population may be using 8 bit
(256) color depth. For those people, a browser safe palette avoids
dithering.
2. There no harm in using a browser-safe palette. True/high color
displays deal with them as well as they do any other color.
3. Browser-safe palettes may come into vogue again as more web content
is "retooled" for mobile display technologies (PDA's, mobile phones,
etc...) with limited color depths
4. CSS allows you to abbreviate browser safe hex codes. For example, you
can specify #f00 for red.
Here are some articles:
[url]http://www.lynda.com/hex.html[/url]
[url]http://hotwired.lycos.com/webmonkey/00/37/index2a.html?tw=design[/url]
HTH
-Chris
Chris Hohmann Guest
-
John Smith #6
Loop
I'm trying to perform a loop to display the contents of my DB, the only
issue is that I would only like to display 10 results maximum this is
relatively easy but what happens if there are less than 10 results in the
DB. If I was going to do a :
Do Until objRS.EOF
Then it would display the full records, likewise if i put a counter on the
loop then it will run into errors if I have less records than the
count.......
ideas ?
thanks.
John Smith Guest
-
John Smith #7
Loop
I'm trying to perform a loop to display the contents of my DB, the only
issue is that I would only like to display 10 results maximum this is
relatively easy but what happens if there are less than 10 results in the
DB. If I was going to do a :
Do Until objRS.EOF
Then it would display the full records, likewise if i put a counter on the
loop then it will run into errors if I have less records than the
count.......
ideas ?
thanks.
John Smith Guest
-
Bob Barrows #8
Re: Loop
John Smith wrote:
What database?> I'm trying to perform a loop to display the contents of my DB, the
> only issue is that I would only like to display 10 results maximum
> this is relatively easy but what happens if there are less than 10
> results in the DB. If I was going to do a :
>
> Do Until objRS.EOF
>
> Then it would display the full records, likewise if i put a counter
> on the loop then it will run into errors if I have less records than
> the count.......
>
> ideas ?
>
> thanks.
With Access and SQL Server, you can use the TOP n construct in your query to
limit the records returned (SELECT TOP 10 <field list> FROM table ...). With
SQL Server, you can also use SET ROWCOUNT to do the same thing.
If you have an antique database that does not support TOP, then simply
combine your counter idea with your DO loop:
dim i
i = 0
Do Until rs.eof OR i = 10
....
i = i + 1
rs.movenext
loop
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Jeff Cochran #9
Re: Loop
On Mon, 20 Oct 2003 22:46:09 +0000 (UTC), "John Smith"
<john@smith.smith> wrote:
Why not just do:>I'm trying to perform a loop to display the contents of my DB, the only
>issue is that I would only like to display 10 results maximum this is
>relatively easy but what happens if there are less than 10 results in the
>DB. If I was going to do a :
>
>Do Until objRS.EOF
>
>Then it would display the full records, likewise if i put a counter on the
>loop then it will run into errors if I have less records than the
>count.......
>
>ideas ?
Do Until objRS.EOF OR count=10
Jeff
Jeff Cochran Guest
-
monimo #10
Loop
I am trying to make a loop from a nested movieclip of my main movieclip that
doesn't suppose to loop, it stops at the last frame. My client wants to offer
his customer the opportunity to make it loop for special presentations. And I
dont know how to do this....can anyone help me??
Thanks
monimo Guest
-
AWD #11
Re: Loop
not sure what you mean. If the nested movie clip does not have a stop action
on its' last frame, and the movie clip layer is extended to the end of the
main time line, it will loop forever unless you have a script to turn it
off. You can always put a button in the movie clip telling it to stop. Or on
the main stage telling it to stop or setting it's visibility to false and
that will make it disappear.
--
Al Winchell
[url]www.Amazingwebs.com[/url]
den.tigersquadron.com
AWD Guest
-
monimo #12
Re: Loop
What I mean is that I have a main movie that stops at the last frame--i put a
stop action in the last frame(it supose to stop) and then i have another movie
clip that pops up over my main movie clip from a button, to give my client the
opportunity to loop the main movie when he has a presentation. so i dont know
how to make that stop action in the last frame to be desactivated just when i
click a button from that other movie clip. I dont know if you understand
me.....or if this is posible.
I am still trying to get it to work. :(
I can use any advise
thanks
monimo Guest
-
AWD #13
Re: Loop
I think I understand although not necessarily. Couple of ways you can do it.
An easy way would be to duplicate your main movie with OUT the stop action
on it.
Call this "duplicateMovie".
Put a stop action on the FIRST frame and a goToAndPlay Fame(2) on the last
frame of his duplicateMovie
Put this movie above the original main movie on the timeline.
When you click to activate your new movie also tell it to play frame 2 of
the duplicateMovie.
When you close the new movie also tell it to goToAndStop on frame 1 of the
duplicateMovie.
could also do it with variables and visiblitly but I think this would be
easier.
If you need an example mail me at [email]alwinch@msn.com[/email]
--
Al Winchell
[url]www.Amazingwebs.com[/url]
den.tigersquadron.com
AWD Guest
-
TJGY #14
Loop
Collision Loop
Two 3D objects collide then go to marker where the play head is held in a
continuous loop. Need something to terminate the loop and reset the 3D world.
I?m assuming that the two objects are still attached and causing the loop.
What code to use to stop this and where should it be placed before, after or
inside the Step frame?
Thanks
TJGY Guest



Reply With Quote

