|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
dynamic text problem!
Ok here is my problem….i have created a banner in flash, I have connected it to a database with cold fusion. Now I have my banner displaying all my dynamic text that you can click on and it will take you to that url. The text is displayed ex. Every 5 seconds there is a new text displayed; now here is what my problem is. I am using an auto number in my database for the newsid field. Say I get to my 4th item in my database that is being displayed; it is the 4th item and has the newsid of 4 as well. Now say I want to display the 5th item, it has the newsid of 9, it would take ex. 12 seconds to display the text because newsid still has to count until it finds item # 5 so it will count 4,5,6,7,8,9 and then it will display it because it has counted to the next newsid. How would I make it so that my flash movie can still receive the information but it doesn’t count the newsid and slow my movie down??? Now another problem is that whatever flashid is set to in the flash movie is how many items it displays, if the flashid is set to 6 (which it is) it will only display items that have a newsid of six and lower….now how can I change this without changing the database which pretty much can not be changed? This is still part of problem one and with figuring out problem one problem 2 should be simple.
Ok so when my movie is complete this is what I am trying to achieve. I would like to have a movie that displays text every 5 seconds with no breaks in between text that loops forever. Here is my cold fusion code: and I will give you my code on my flash movie. I have also attached a SWF file and my database. COLDFUSION CODE: code:-------------------------------------------------------------------------------- <cfsetting enablecfoutputonly="Yes"> <cfquery name="ListResults" datasource="whats_new"> SELECT * FROM Newsitems WHERE appletflag = 1 AND newsid=#form.flashid# <cfoutput query="ListResults"> <align="center">&title=<a href="#ListResults.url#" target="_new">#title#</a>&url=#url# loaded=1 </cfoutput> -------------------------------------------------------------------------------- FLASH CODE: FRAME ONE flashid = 1; FRAME TWO loadVariablesNum ("query.cfm", 0, "POST"); FRAME FOUR if (loaded=="1") { play(); } else { gotoAndPlay(4); } THE LAST FRAME loaded = 0; flashid=flashid+1; if ( flashid==6 ) { stop(); } else { gotoAndPlay (2); } PLEASE HELP! Thank you so much for ALL your help! It is greatly appreciated! |
|
#2
|
|||
|
|||
|
hrmm...
i don't know much about the flash part... i'm guessing you just have infinite loop in the flash that calls the cf page. here's how i would approach it.. i would add another query to the cf code. select newsid from newsitems where appletflag = 1; order by newsid (or is it sort by? might want to look into caching this query if it's a problem) from this you should have all the newsids ordered. now create a list or an array out of this. then you want to avoid ur 2nd problem: <cfset index = form.flashid mod (queryabove.recordcount+1)> it should cycle once it hits the last record modify existing query: SELECT * FROM Newsitems WHERE appletflag = 1 AND newsid=#listgetat(index,listcreatedfromquery)# there's probably alot syntax errors etc.. but as long as you get the idea. let me know how it goes |
|
#3
|
|||
|
|||
|
actually u can avoid coverting it to another list or array...
since it's already an array queryfromabouve.newsid[index] or somthing like that |
|
#4
|
|||
|
|||
|
Hey Dork, thank you so much for your reply! I was just hoping that you would be able to explain to me in a little more detail if you wouldnt mind it would be greatly appreciated!
thanks , Karyn |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > dynamic text problem! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|