
Welcome Guest
|
|
|
#1
|
|||
|
|||
|
to display dynamic text passed from jsp script
Hello,
Im having a flash animation. i want to display a text inside that animation that is passed by a jsp script of the site coding.(ie, my page is designed using jsp). can anyone gie ideas on how to accomplish this. |
|
#2
|
|||
|
|||
|
I don't know jsp, but I do know you have to send flash the info like this:
"&name=value&name=value" In ASP you would use for example: Response.Write "&text=Hello&colour=red" So whatever the equivilent is in JSP (maybe printf?) You can just have an html page with nothing in it but &text=Hello&colour=red which isn't very flexible, but it works :-) To get at it in flash use something like: var sendVars = new LoadVars(); var returnVars = new LoadVars(); sendVars.sendAndLoad("http://www.mysite.com/mypage.jsp", returnVars, "GET"); returnVars.onLoad=function(successful) { if (successful) { trace (this.text); trace (this.colour); } else { trace("Site not found"); } } Hope that helps |
|
#3
|
|||
|
|||
|
thanx
thank u for the reply. but we have a different prob. we cant pass the parameter in query string, but we pass the values through form hidden values. Is there anyway to pass the parameter like <input param = "name" value="value">, to flash and to receive it. Please reply immediately. It is urgent.
THanx in advance |
|
#4
|
|||
|
|||
|
Sorry been out of circulation for a few days.
Flash doesn't let you control it. It must be in control. It must tell the server when it wants the information and the server must respond. Using a form with <input> does not do this. You will have to build the form with flash and not html. That way it is in control. |
|
#5
|
|||
|
|||
|
You can, however, pass initial parameters to Flash.
In the <object> tag, after the .SWF add the usual query string stuff. eg. blah.swf?name=value&name2=value2 and within the Flash, just manipulate the _url string to get these values. But it sounds like you want to control Flash throughout - no can do. |
|
#6
|
|||
|
|||
|
Thank u very much graham...Can u hlp this time?
Thank u very much 4 your reply graham. Ill give u my actual requirement. perhaps u can help me. Im having a menu in flash with a button labelled "email" in it. the whole menu is animated and behaves like a dropdown menu. my requirement is that since i m having alot of different clients using the page for their respective corporates, i need to make the email link dynamic. ie in some pages that link should lead to a link of a particular client and in some other pages, it should lead to some other. That depends upon the client list. I plan to pass the email link through jsp script and then update the link automatically in the flash button using the geturl() function .
Hope u understand my problem... Plz help... |
|
#7
|
|||
|
|||
|
XML
If you need to pass a lot of data at the start of the application. Try using XML instead.
Get your JSP code to generate an XML file with all the client URL's in it. For example <info> <client name="Client 1" url="www.client1.com" /> <client name="Client 2" url="www.client2.com" /> <client name="Client 3" url="www.client3.com" /> </info> Then pass the name of the xml file. eg. blah.swf?xml=clients.xml Flash has built in functionality for reading XML files - see XML class and XMLNode class in the built in help. --------------- If your dataset is very large, then you will need to query the server at run time. You will need to build a JSP page that accepts a request for a URL and returns it. This can be done in Flash as I have already explained using sendAndLoad. Again, I don't know JSP, and I don't know how your data is stored. But in ASP anything coming from Flash can be accessed using the Request function. Taking the example above and adding a parameter to it, we get: var sendVars = new LoadVars(); var returnVars = new LoadVars(); sendVars.client=1 sendVars.sendAndLoad("http://www.mysite.com/mypage.jsp", returnVars, "GET"); returnVars.onLoad=function(successful) { if (successful) { trace (this.clientURL); } } Here Flash sends the client=1 name/value pair to the server. In ASP you would use Request("client") to retrieve the value. I don't know what the equivelent is in JSP, you'll have to look it up. In this example, Flash is expecting a name/value pair for clientURL. Does any of that help? |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Video Player - XML Driven Dynamic Script Text Box | paswicka | Actionscript 2.0 |
1 | 06-28-2007 02:34 PM |
| Dynamic Text - change text box variable on click | kenisswell | Flash MX ActionScript |
10 | 11-01-2005 09:20 PM |
| Problems with dynamic text display... | bearslife | Flash MX 2004 |
0 | 01-19-2005 07:10 PM |
| Ideas or script? timed dynamic text, arrays, and external text | rbruhn | Flash MX ActionScript |
0 | 07-08-2003 07:16 PM |
| Setting Dynamic Text in Frame Scripts | zorba990 | Flash MX ActionScript |
4 | 04-28-2003 11:32 PM |

Programming Languages


