View Full Version : flash stops displaying dynamic html data when it reaches quotations
yazgar
07-26-2005, 04:18 PM
Hi Everyone, I'll try and keep this short and sweet.
I am designing a skin for a dvd database program (DvdProfiler) that displays dvd info through a html skin. I am designing a skin which uses flash to display the dvd data.....ok.
This is the relevant html code in my skin which assigns the variable name 'title' to the dvds description text data:
<PARAM NAME=FlashVars VALUE="title=<DP NAME="OVERVIEW">
..... the <DP NAME="OVERVIEW"> tag recieves the selected dvds description text from DvdProfilers data files.
The dvd description data is recieved by the embed flash movie and sent to a dynamic text field in an animated MC with this code:
_root.onEnterFrame = function() {
myMclipInstance.display = title;
};
It displays the dvds description perfectly, except when the description text has quotations, we all know what happens then. The text is only displayed until it reaches the first " then it stops!
I cannot access or change the descriptions that dvdprofiler uses because they are data files.
How can I get flash to display all the text even when it contains " marks??
Any suggestions would be greatly, greatly appreciated. :)
CyanBlue
07-26-2005, 04:27 PM
Howdy and Welcome... :)
Generally speaking, you do need to escape the special characters such as & or = in your content...
Can you post the actual content of the description text???
yazgar
07-26-2005, 04:50 PM
Thankyou for the fast reply!
I checked a lot of the different dvds text. Characters like .. <(:;?/- and returns ie <BR> and <P> work fine within the text. Not sure about & or = (can't find a description with one yet).
Here's the code below, for the whole skin, when I 'viewed source' while displaying the dvd 'snatch'. You can see the description text is assigned to 'title' but in the flash MC the text stops at the word debut
I have been googling all day, but I have limited Ascript knowledge and even less when it comes to javaScript funtions. I have collected a whole lot of different script snippets but have no idea if they could work or where to put the darn things. I'll post them if you think it might help.
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=unicode">
<TITLE>movie</TITLE>
</HEAD>
<BODY bgcolor="#cccccc">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="550" HEIGHT="400" id="movie" ALIGN="">
<PARAM NAME=movie VALUE="../../IPA/movie.swf">
<PARAM NAME=FlashVars VALUE="title=Guy Ritchie's follow-up film to his successful debut "Lock, Stock and Two Smoking Barrels", is another lurid trip into the British underworld and another cult smash-hit! Along for the ride this time are Brad Pitt (in a dazzling performance that was acclaimed by the critics), Benicio Del Toro (best known for his role in "The Usual Suspects"), Dennis Farina (from "Get Shorty") and Lock Stock's Vinnie Jones in a story about a diamond heist gone helter-skelter. Laced with brutal violence, brutal humour and a brilliant soundtrack, "Snatch" is a cool new thriller from a hot new director - don't miss it!
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="../../IPA/movie.swf"
FlashVars="title=Guy Ritchie's follow-up film to his successful debut "Lock, Stock and Two Smoking Barrels", is another lurid trip into the British underworld and another cult smash-hit! Along for the ride this time are Brad Pitt (in a dazzling performance that was acclaimed by the critics), Benicio Del Toro (best known for his role in "The Usual Suspects"), Dennis Farina (from "Get Shorty") and Lock Stock's Vinnie Jones in a story about a diamond heist gone helter-skelter. Laced with brutal violence, brutal humour and a brilliant soundtrack, "Snatch" is a cool new thriller from a hot new director - don't miss it!"
quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="movie" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</HTML>
CyanBlue
07-27-2005, 03:06 AM
Hi... :)
Try using the urlencoded character for the actual quote by using %22...
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14143
So, your string will look like this...
<PARAM NAME=FlashVars VALUE="title=Guy Ritchie's follow-up film to his successful debut %22Lock, Stock and Two Smoking Barrels%22, is another lurid trip into ... ... ...
yazgar
07-27-2005, 04:58 PM
Yes, this is the way to go. Unfortunately I cannot manually urlencode the text because it comes from the data files within the program. hmmm..
I think the best bet is to urlencode the text when it is received by the <DP NAME="OVERVIEW"> tag.
So I need to define a javascript function that can find the special characters " and & and = and + then replace them with %22 %26 %3D %2B respectively. This function needs to be put into the :
<PARAM NAME=movie VALUE="../../IPA/movie.swf?title=<DP NAME="OVERVIEW">">
Not sure how to do that. ( think I need to learn some javascript) :eek:
If you have any ideas, I'll certainly try them. :)
yazgar
07-28-2005, 02:42 PM
Hi All.
Just wanted to close off this topic and thank Cyanblue and anyone else who was working on the problem. It has been solved with javascript beautifully.
For anyone who has stumbled into this thread in search of a solution to this real annoying problem, it is HERE (http://www.intervocative.com/Forums.aspx?task=viewtopic&topicID=102631&PageNum=3). Read the thread, it's all there. :)
cheers
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.