homepage Welcome to WebmasterWorld Guest from 54.227.77.237
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
Forum Library, Charter, Moderator: open

Site Graphics and Multimedia Design Forum

    
Flash MX and special characters
Having trouble
Sinner_G




msg:861010
 2:11 pm on Jan 10, 2003 (gmt 0)

I'm trying to get Flash MX to show the & character. Tried to write it normally, tried octal, tried hexadecimal, nothing works. Did I miss something?

Thanx
Sinner

 

mivox




msg:861011
 8:28 am on Jan 11, 2003 (gmt 0)

Have you tried &? That's what I use in xhtml.

korkus2000




msg:861012
 2:26 pm on Jan 11, 2003 (gmt 0)

Where are you using it that it doesn't work. Works fine for me in regular text.

Sinner_G




msg:861013
 7:28 am on Jan 13, 2003 (gmt 0)

AFAIK & works only for HTML and the like.

First I tried to use it in an import from a text file. When that didn't work, I tried an actionscript to replace variable e.g. 'BlackWhite' by 'Black&White' in the Flash file itself. No success either. Strangely, most characters work, just not characters with octal codes from 041 to 047.

korkus2000




msg:861014
 12:40 pm on Jan 13, 2003 (gmt 0)

In actionscript & is the concatination character. No luck there. When you are pulling from a text file it is part of the name value pairs so it is not allowed. I believe there is a code for it but don't know off hand. I will take a look and let you know.

Sinner_G




msg:861015
 12:44 pm on Jan 13, 2003 (gmt 0)

Thanks Korkus, but if the code you're talking about is the \octal, then it doesn't work for me...

<added>Had to search for the exact code: \046, which doesn't work. Also \u0026 (unicode) got me nowhere. Tried both in the text file and in the actionscript.

korkus2000




msg:861016
 1:08 pm on Jan 13, 2003 (gmt 0)

Try %26. Its like URL encoding with ASCII. It should work if you place it directly in the text file. You can use all the % ASCII codes in flash text files.

Sinner_G




msg:861017
 1:29 pm on Jan 13, 2003 (gmt 0)

I get Black26White... (text file as well as flash file)

korkus2000




msg:861018
 1:34 pm on Jan 13, 2003 (gmt 0)

Here is Macromedia's page about it.
[macromedia.com...]

If you are using MX then you can also use unicode stuff. %26 works fine here. Look through that page and see if maybe you have missed a setting or something.

Sinner_G




msg:861019
 2:01 pm on Jan 13, 2003 (gmt 0)

I saw this page before too. And their example doesn't work for me. In fact, nothing works with the %.

korkus2000




msg:861020
 2:04 pm on Jan 13, 2003 (gmt 0)

What version of Flash are you using? This is really strange. Are you making this from an example? If so what example? Also try just a name value pair with % codes and nothing else.

Sinner_G




msg:861021
 2:24 pm on Jan 13, 2003 (gmt 0)

Using Flash MX (6.0). Not an example, it is a flash navigation (before everybody starts yelling, it's just an optional navigation, the user can turn it off and navigate by normal HTML links ;)). Strage thing is that other special characters like the french accents are no problem.

name value pair? Either my english or my flash knowhow can't follow you.

korkus2000




msg:861022
 2:35 pm on Jan 13, 2003 (gmt 0)

This is a name value pair that is in the text file but usually seen in query strings.
name=value

make a text file and call it in to flash with 1 name value pair like:

test=%26

see if it works or not.

Sinner_G




msg:861023
 2:54 pm on Jan 13, 2003 (gmt 0)

I see what you mean now. But it doesn't work, I get back a nice '26' :(.

I don't think it has anything to do with the text file itself or the import. As written above, even if I try to replace the 'BlackWhite' by a 'Black&White' in the flash file, it won't show. Same for 'Black%26White'.

korkus2000




msg:861024
 2:55 pm on Jan 13, 2003 (gmt 0)

What operating system are you using? Do you know what character encoding it uses?

Sinner_G




msg:861025
 3:03 pm on Jan 13, 2003 (gmt 0)

Win2k. Not sure what encoding it uses, but as I can enter the & character as static text in the movie, that should not be the problem.

I get the feeling all possible sources for that problem are being eliminated one after the other. :(

korkus2000




msg:861026
 3:09 pm on Jan 13, 2003 (gmt 0)

try Black+%26+White

Sinner_G




msg:861027
 3:14 pm on Jan 13, 2003 (gmt 0)

Black26White. Again.

korkus2000




msg:861028
 3:16 pm on Jan 13, 2003 (gmt 0)

There is something wrong with your % sign. Try %25 which is a % sign.

Black+%26+White is giving you Black26White? You should at least get a space in front and behind the 26? This is really odd.

Sinner_G




msg:861029
 3:29 pm on Jan 13, 2003 (gmt 0)

Black%25White gives Black25White.

korkus2000




msg:861030
 3:30 pm on Jan 13, 2003 (gmt 0)

Can you post the entire text file with any widgetization needed.

Sinner_G




msg:861031
 4:08 pm on Jan 13, 2003 (gmt 0)

Ok, this is the text file (called models.as):

var models = new Array(

"widget1:1 widget",
"widget2:2 widgets",
"widget3:3 widgets",
"widget3a:3 widgets black&white",
"widget4:4 widgets",
"widget4a:4 widgets déjà vu",
"widget4b:4 widgets black&white"

);

It is imported by the following command from the .fla file:

#include "models.as"

And used by this variable:

modelFont.Description = getModel(modInt,langPos);

which is a variable for a dynamic text.
The getModel function is used to separate between the languages the site is in. I delete them here, but they would just be another : followed by the text in that language.

Hope I didn't delete too much while widgetising.

korkus2000




msg:861032
 6:17 pm on Jan 13, 2003 (gmt 0)

I didn't know you were using action script in the text file. Give &amp; a try. & is going to cause problems in the action scripting. You are basically concatinating the strings in your file.

Sinner_G




msg:861033
 7:37 am on Jan 14, 2003 (gmt 0)

Already tried it. Shows BlackampWhite... Even tried %26amp;. Guess what it shows :(.

Sinner_G




msg:861034
 8:11 am on Jan 14, 2003 (gmt 0)

GOTCHA!

What happened was that the embedded font was not set in the right way. If you go to the field where the text is used and open the Properties window, next to the variable name, you have a button 'Character...' where you can choose the character options. There you can choose which font outlines to embed. For some reason, default seems to be only to embed uppercase and lowercase letters as well as numbers, but NOT punctuation... So now I selected to embed all font outlines and...IT WORKS! :)

Anyways, Korkus, thanks a lot for the help. (BTW, even with that option selected, the %26 doesn't work, neither does the &amp;. \046 works, though, as described in the Flash Help.)

korkus2000




msg:861035
 12:48 pm on Jan 14, 2003 (gmt 0)

Good to know Sinner_G. I guess I need to bone up on my .as file usage. I usually pull strings from a database. Definitely a tip I will remember thanks. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved