Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




LoadVars Containing Swedish Characters From MySQL Not Working?



I'm trying to load variables containing Swedish characters (such as å,ä,ö) from a MySQL database with a PHP script, without any success. When I look at the database in phpMyAdmin, for instance, å,ä,ö appears as they should, but when I try to show them in Flash they are not shown properly, they are just substituted with a squre. So there is probably a problem with the character set somewhere in the link, I just dunno where!? Usually we use the character set ISO-8859-1 rather than the common UTF-8. Anyone that have experienced the same problem?



ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 06-22-2005, 07:14 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Swedish Characters Distorted When Sent To Asp.
I'me using a simple asp formmail. When characters like åäö are sent to the asp they turn out like ä etc.

I've tried using

code: System.UseCodePage = true;

But that only gives me an actionscript error when i test the movie, and it doesn't work. I'me using Flash 2004 Proffessional.
Please help!

Swedish Characters In Dynamic Textfield
Hi!

Im wondering how I can ge my Dynamic textfield to display swedish characters (loaded from a xml-file)?

I think i just had to add some code in the dynamic textfield object, but I dont remember, really.

Thanks.

Swedish Characters In Dynamic Text Fields
I'm trying to get my dynamic TextField to accept input of swedish characters (as in åäöÅÖÄ), and keep failing at it... do I need to set something special in my AS3 code? Embedding extended latin doesnt seem to do the trick...

Thanks for any hints on this.

Extended ASCII Characters In MySQL Database
I have a mySQL database that contains characters in the extended ASCII character set. The characters are accented characters in french, german, spanish and italian.

I am using the standard AMFPHP model where a PHP service is written to access the database and return the results to Flash. Here is a sample implementation of one of my remote PHP methods:


PHP Code:



function getItem($id)
{
    if ($this->connection)
    {
        $result = mysql_query("SELECT * FROM tableOfItems WHERE stringID=$id");

         return $result;
     }
     else
     {
         return false;
     }
 } 




The problem I'm having is that Flash seems to receive these extended characters as question marks (?) even though they seem to be properly present in the mySQL database. For example, I ssh onto my server and type:


PHP Code:



#> mysql myDB
mysql> SELECT * FROM tableOfItems WHERE stringID=4; 




and I see my database entry with the extended characters: Zurück

However, when I access this database entry using AMFPHP, I get back a string without the extended characters. Here is the output from the NetConnection Debugger:


PHP Code:



Result (object #2)
.....mRecordsAvailable: 1
.....serverInfo: (undefined) 
.....uniqueID: 1
.....items (object #3)
..........[0] (object #4)
...............__ID__: 0
...............itemComment: ""
...............itemID: "12"
...............itemMSApp: "0"
...............itemNintApp: "0"
...............itemSonyApp: "0"
...............itemString: "{IMG_B}Zur?"
...............itemTimestamp: "20050131164819"
...............languageID: "2"
...............prodStageID: "2"
...............stringID: "4"
...............userID: "2"
.....mTitles (object #5)
..........[0]: "itemID"
..........[1]: "stringID"
..........[10]: "itemComment"
..........[2]: "languageID"
..........[3]: "prodStageID"
..........[4]: "userID"
..........[5]: "itemTimestamp"
..........[6]: "itemMSApp"
..........[7]: "itemSonyApp"
..........[8]: "itemNintApp"
..........[9]: "itemString"
.....views (object #6)
..........No properties 




As the <itemString> field is corrupt at this point I am assuming that the problem is with the PHP mysql_query() command.

Anybody have any suggestions?

Help - CMS PHP / Loadvars / MySQL
Alright guys
Just asking for a wee bit of help as i'm totally stuck...
Basicly i'm in the middle of creating a cms system in flash... it's not overly fancy, and it's aimed at designers - so the main priority will be making it skinable - but it'll be able to update sections with text / images via an admin panel... i'm not so much of a coder, more of a designer with a little bit of actionscript knowledge, so most of it's built with various open-source projects i've 'frankstiened' together, but i'm having problems with some things, so I wondered if somebody would point me in the right direction.
Oh, and I fully intend to make this project open source... just need to make it work first

First problem... (MySQL. Loadvars / PHP related)

the main sections on the front end draws info from a MySQL database, which has the following sections

id
creator
title
cat (catagory)
text (body)
date

Now basicly each page in the frontend needs to display the title, body, creator and date... but here's the thing - each section has a different catagory - for example News / About - the former will only pull entries with the catagory 'news' and the latter section will only pull the entries marked 'about' .

I've got the basic php to pull it all in, but i'm not too sure if the catagory sorting should be (or could be) in the php or in the actual actionscript.. any suggestions


Code:
<?
$server = "localhost";
$user = "root";
$pass = "root";
$database = "cms";
$tableName = "blog";
$conn = @mysql_connect($server,$user,$pass);
$database = @mysql_select_db($database,$conn);
$query = @mysql_query("SELECT * FROM $tableName ORDER BY posted desc");
$total_rows = @mysql_num_rows($query);
$counter = 0;
while($myNewsData = @mysql_fetch_array($query)){
$id = $myNewsData["id"];
$creator = $myNewsData["creator"];
$title = $myNewsData["title"];
$cat = $myNewsData["cat"];
$link = $myNewsData["link"];
$text = $myNewsData["text"];
$date = $myNewsData["date"];
$posted = strftime("%d-%m-%y", $myNewsData["posted"]);
$counter++;
print("&news_data$counter=$id|$creator|$title|$text|$date|$cat");
}
print("&total=$total_rows");
?>
The second problem is within the admin interface... the main edit panel looks like this

(s'cuse the ****ty name , it will be changed)



When you click the image button (the one with the two squares with the plus) a pop up appears with basicly options for image sizeing / alignment, but it requires the user to input the image location. What I want to do is add a photobrowser, so you can click a button beside the input and this'll pop up - or something like it once i've reskinned it..



betriebsraum's awesome file browser - http://www.betriebsraum.de/blog/2006...-file-browser/

Basicly I need to create a button so that when you select a pic, you just press an it and it will input the image url into the image location box..
anyone know what i'm on about ?
hope i've explained this clearly..

Any help will be just totally awesome..

Thanks

Liam

LoadVars With Mysql Database
I'm using this example found here: http://www.flash-creations.com/notes/servercomm_database.php

And like the tutorial shows I am loading data through php from mysql. The problem is when I create new frames the information from the mysql database wont go away and keeps loading in. Please take a look at the picture: Found here

Is there someway of clearing or unloading this data before the next frame loads?







Attach Code

select_lv.onLoad = function(ok:Boolean) {
if (ok) {
if (this.errorcode=="0") {
for (var i:Number=0; i < this.n; i++) {
scoreInfo.push(
{record:this["id"+i],
nickname:this["nickname"+i],
score:Number(this["score"+i]),
dateposted:this["dateposted"+i]
});
}
// only display Nickname, Score, and Date Posted (not record id)
scores_dg.columnNames = ["nickname", "score", "dateposted"];
// set formatting of nickname column
scores_dg.getColumnAt(0).width = 200;
// trap header click event to sort case-insensitive on this field
scores_dg.getColumnAt(0).sortOnHeaderRelease = false;
// this property will keep track of whether sort is ascending or descending
scores_dg.getColumnAt(0).sortedUp = false;
scores_dg.getColumnAt(0).headerText = "Nickname";

// set formatting of score column
scores_dg.getColumnAt(1).width = 100;
// trap header click event to sort numerically
scores_dg.getColumnAt(1).sortOnHeaderRelease = false;
scores_dg.getColumnAt(1).sortedUp = false;
scores_dg.getColumnAt(1).headerText = "Score";

// set formatting of date column
// auto-sort will work fine for this column
scores_dg.getColumnAt(2).width = 160;
scores_dg.getColumnAt(2).headerText = "Date Posted";

// set dataProvider for datagrid
scores_dg.dataProvider = scoreInfo;

// execute headerRelease function for correct sort when user clicks a header
scores_dg.addEventListener("headerRelease", headerListener);

msg_ta.text = "Enter data and click Add to add a score. Click a row and Delete ";
msg_ta.text += "Selected to delete a score. First four entries may not be deleted.";
} else {
// show kind of error
msg_ta.text = errorMsgs[Number(this.errorcode)];
// if query error, show mysql_error
if (this.errorcode == "3") msg_ta.text += ": " + this.msg;
}
} else {
// if loadvars failed (eg, if script not found)
msg_ta.text = "Flash-database select operation failed";
}
}
msg_ta.text = "Getting high scores from database...";
select_lv.sendAndLoad(filepath + "getscores.php", select_lv, "GET");

News Php/mysql Loadvars
hello all. i'm trying to put together a simple news system in flash that queries a database of news entries. now, for each news entry in the database i want flash to duplicate a movieclip which contains two dynamic text fields: author and message, with a scrollbar that will allow the user to scroll down to previous entries.

so far all the tutorials i've found on the web are rather crude (news tickers and such, blech..) and was just wondering if there were a few tips you guys can throw my way regarding php/actionscript.

thanks.

jay

Loadvars With Special Characters
I use a LoadVars object to load rows from a database (with PHP in the middle). This works great, except that some of the data I'm loading has special characters, like:


ö, è, ñ, ä, etc.


What happens with these characters is that they screw up the rest of the text in the variable, including the following '&' sign, which is used to mark where one variable ends and the next begins, like so:

varname1=bob&varname2=pequeño&varname3=mike

So, my LoadVars object looks like this once the data is loaded:

LoadVars.varname1 = "bob"
LoadVars.varname2 = "peque□varname3=mike"


The database contains non-English names that really aren't spelled correctly without these characters so I'd rather not get rid of them.

Can anyone tell me how to avoid this? Thanks much.

-Brian

Loadvars Invalid Characters Â
Hey,

I am using the loadvars object to send data to my asp page. I have noticed that flash is adding additional characters when sending out data to the page.

For example if I enter "£" into a text field then send it to my page, my page recieves "£".

This is causing a lot of issues for me. For one, I set the maxchars on a text field to 50, the user enters 50 characters. When the asp page receives this data though its more as the addtional  as been added bringing it up to 51 characters, which causes the page to error when trying to insert this data into the database?

Is there anyway to stop flash doing this?

At the moment I have to remove  from every string my page recieves from flash. I have serveral movies using multiple pages.

Thanks

Leah

'special' Characters In Loadvars
I am using a loadvars function to load a text file into my flash movie. Can someone explain to me why characters such as & and % will not show up? Is there any way around this?

LoadVars And French Characters
Hi all

Bit of an odd one, but I have a flash game with french text. at the end of
the game, a block of text (which varies depending on what happens in the
game), is emailed out to you. The email is sent using an .asp script and
'loadVars' and 'sendAndLoad'

The problem is, the resulting email does not have the french characters in -
instread they are replaces with a couple of other characters (like é).

The thex appears fine in flash - a trace in flash shows them fine too.
Using the asp file on its own in a browser and manually adding a french
sentance works fine too.
I'm kinda thinking its when flash 'posts' the text string that the charset
is being lost or something?

Does anyone have any clues? Or is there a way of doing a sendAndLoad 'POST'
with charset=iso-8859-1

If anyone needs a more detailed explanation, let me know


Tim

tim@fullsizemediaREMOVETHISSPAMBIT.com.uk

LoadVars And Acented Characters
Hi when I try to load a txt file with name/value pairs, The accented charaters do not appear.
For example: $Local=José
The é character is not loaded properly. What can I do?

See attached code









Attach Code

var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function (success:Boolean):Void
{

if (success) {
_global.host = this.$Host;
trace("HOST = "+_global.host);
_global.local = this.$Local;
trace("LOCAL = "+_global.local);
_global.terminal = this.$Terminal;
trace("TERMINAL = "+_global.terminal);


trace("Sucess!")
} else {
trace("Fail!");
stop();
}
};
my_lv.load("parameters.txt");

LoadVariables/php/MySQL -> Fail In Displaying Double-byte Characters
I am working on a chinese MX project. Using loadVariables to grasp the Traditional Chinese (big5) content from the MySQL by php.

With a view to show the content anywhere, including Mac OS and English computer with Chinese characters support, I am going to change the data to unicode. However, I fail , even using utf8_encode() function in my php file.

The chinese characters are showed well on Chinese PC, but not on Mac or English PC.

I am crazy now! Any help is appreciated.

Thanks!

LoadVars & Connecting MySQL To Flash...
Good morning!

I am currently trying to make a Starmap for a game which will load the coordinates of the stars when you enter the code for it (1-11800~). I have compiled a Database which has 5 variables per Star in it and when I use the PHP as seen below:




PHP Code:



<?
        $dbh = mysql_connect("aaa", "bbb", "ccc");
        $query = "use aaa";
        if (!mysql_query($query, $dbh)) die("Datenbank existiert nicht.
");
        $query = 'SELECT * FROM navigator WHERE system_name="'.$_GET["system_name"].'"';
              //if (!mysql_query($query, $dbh)) die("Fehler beim INSERT von Galaxen.
");
              $result = mysql_query($query, $dbh);
            echo mysql_error();
            $arr=mysql_fetch_row($result);
            echo "&system_name=".$arr[0]."&coordx=".$arr[1]."&coordy=".$arr[2]."&coorda=".$arr[3]."&coordb=".$arr[4]."&coordc=".$arr[5];
            mysql_close($dbh);
?>




I am handed the following response:


Quote:




&system_name=1234&coordx=537&coordy=178&coorda=118 &coordb=-7&coordc=299





What I am trying is to get Flash to understand these are variables it should be loading into the program because I have multiple functions that use exactly these variables. So I coded this into my Flash Application (This is in the Timeline and not on the button)


PHP Code:



Calc.onRelease = function ()
{
        var n = new LoadVars();
        n.onLoad = function(OK) {
                if(OK){
                        trace("getcoords.php?system_name="+SystemNr.text);
                        trace("coorda="+coorda);
                        trace("coordb="+coordb);
                        trace("coordc="+coordc);
                        trace("coordx="+coordx);                        
                        trace("coordy="+coordy);
                        /* The next 4 functions use the variables coming from the php file */
                        karte();
                        yline_mc.move(yline_mc._x, Number(coordy), 8);
                        xline_mc.move(Number(coordx), xline_mc._y, 8);
                        Flugzeit(coorda,coordb,coordc);
                } else {
                        trace("This script is broken.");
                }
        }
        n.load("getcoords.php?system_name="+SystemNr.text,"");
};




Since I couldn't find out what the problem was I placed some traces as seen above. I end up getting shown that the number I input (in this case 1234 as example) gets read in but I think I have a problem getting the variables actually loaded into the program.

Is it maybe because flash needs a bit more delay to make sure it has what it needs before proceeding ? I tried that with LoadVars as seen above but to no avail =/

The trace result:

getcoords.php?system_name=1234
coorda=
coordb=
coordc=
coordx=
coordy=

I think what I am missing is something minor but I can't seem to find where I am lacking =/ Any help would be extremely appreciated ! Thanks in advance.


Phelan

[F8] Using LoadVars To Send Data To MySQL
Can anyone guide me through sending data to a mySQL database?

Basically a user inputs some text into an input field and the text is placed into an existing mySQL database.

Here is the AS Code on the button:

Code:
on (release) {
var regVars:LoadVars = new LoadVars();
regVars.action = 'store';
regVars.productdoes = tWhatDoesItDo.text;
regVars.sendAndLoad("http://localhost/project/version%204/store.php", regVars, "POST");
btnSubmitForm.enabled = false;
regVars.onLoad = function() {
tWhatDoesItDo.text = "success";
};
}
and the PHP code:

PHP Code:



<?php

   $host = 'localhost';
   $dbuser = 'root';
   $dbpass = 'dbpassword';
   $dbname = 'dbname';
   $table = 'dbtable';
   $db = @mysql_connect($host,$dbuser,$dbpass) or die("error=could not connect to $host");
   $db = mysql_select_db($dbname);
   if(!$db)
   {
      print "error=could not connect to $dbname table";
      exit;
   }
   
// ---
// storing details
// ---
function store($productdoes)
{
   $db, $table;
   $productdoes = trim($productdoes);
   $query = @mysql_query("INSERT INTO $table (productDoes) VALUES "
   ."('$productdoes')");

}
?>




There's definately a problem, as nothing is placed into the database.

Loadvars Flash & MySQL Query
Can somebody help me to find a solution to this example?
I'm working on a tutorial I found in Macromedia Flash Developer Center:
This is the PHP Script that shows images and data stored in a MySQL database. I have modyfied it...



<?php
mysql_connect("localhost","root","");
mysql_select_db("flashcms");

$tab = $HTTP_POST_VARS['thisLetter'];
$qr = mysql_query("SELECT * FROM press WHERE LEFT(magazine,1) = '".$tab."' ORDER BY date");


// start output string with number of entries
$nrows = mysql_num_rows($qr);
$rString = "n=".$nrows;

for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
$rString .= "&magazine".$i."=".$row['magazine'] /*."&firstName".$i."=".$row['firstName'] */;
$rString .= "&date".$i."=".$row['date'] /* ."&email".$i."=".$row['email']*/;
$rString .= "&picFile".$i."=".$row['picFile']."&caption".$i."=".$row['caption'];
}
echo $rString;
?>


/////////////////////////////////////////////////////


In the actionScript frame I have got the following:

function showjpg(paramString) {
// get the individual parameters:
// params[0] = picture file name
// params[1] = caption
var params = paramString.split("#");
picHolder.loadMovie(params[0]);
caption.text = unescape(params[1]);
}
function showContent() {
var i;
content.htmlText = "";
for (i=0; i < this.n; i++) {
if (this["picFile"+i] != "") {
content.htmlText += "<b>" + this["magazine"+i] + " " + "</b>" + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" + escape(this["caption"+i]) + "'>&nbsp;&nbsp;(<font color='#0000cc'>pic</font>)</a><br>";
} else {
content.htmlText += "<b>" + this["magazine"+i] + " " + "</b><br>";
}
content.htmlText += "&nbsp;&nbsp;" + this["date"+i] + "<br>";
// content.htmlText += "&nbsp;&nbsp;<a href='mailto:" + this["email"+i] + "'>" + this["email"+i] + "</a><br><br>";
}
}


Everything's ok so far... but I'd like to show the query as soon as the movie loads - directly - instead of showing data according to the letter of the tab pressed.

http://www.adobe.com/es/devnet/flash/articles/flashmx_php.html

Thank you very much in advanced for your help.

Kind regards.

Angel

[FLASH8] PHP/mySQL/LoadVars Problem
Ok, I'm starting to go crazy here. I'm trying to do a simple LoadVars operation to get Flash to hit a PHP script which queries a database and returns the results to Flash. I've done this before and never had these kind of problems...so either I'm completely losing my mind or I'm doing something horribly wrong.

Here's what I have:

Flash 8 Pro, PHP 5 and mySQL 5 which are running on an Apache 2 server, and I have Flash Player 8.5 installed.


Here's my code:

PHP


Code:
<?php
include "db_details.php";

$whichSet = $_POST["whichSet"];
//$whichSet = "all";

if($whichSet == "all"){
$queryString = "SELECT * FROM cardsets";
} else {
$queryString = "SELECT * FROM cardsets WHERE cardsets.setType = '$whichSet'";
}

$mysql_connection = @mysql_connect($hostname, $username, $password);
mysql_select_db($database);

$qr = $queryString;

$Result = mysql_query($qr);
$nRows = mysql_num_rows($Result);

$Return = "&success=yes&n=".$nRows;

for($i=0; $i<$nRows; $i++){
$row = mysql_fetch_array($Result);
$Return .= "&set".$i."=".$row['setName'];
}

mysql_free_result($Result);
echo $Return;
?>
ActionScript


Code:
setQuery = new LoadVars();
setQuery.onLoad = setsLoaded;
setQuery.whichSet = setType;
setQuery.sendAndLoad("php/getSets.php", setQuery, "POST");

function setsLoaded(){
trace("Success = " + this["success"]);
trace("Number of sets = " + this["n"]);
}
The problem is when the data comes back to Flash. It appears that there is TOO MUCH data being returned. Here is what the above trace statements send to my output window.


Code:
Success = yes
Number of sets = ".$nRows;



for($i=0; $i<$nRows; $i ){

$row = mysql_fetch_array($Result);

$Return .= "
So as you can see, instead of returning the number of results as I want it to, it's sticking in the PHP code in between the set of quotes.

Am I a complete idiot? Am I totally missing something? I've been staring and tweaking this code for hours. I've gone through every tutorial I can find and have cut and pasted their code in and same thing. It's driving me CRAZY?!

Could this be some sort of bug with Flash Player 8.5 or Flash 8 Pro?

I'm so lost. Any help or suggestions y'all could give would be greatly appreciated.

Thanks,
RD

Retrieving Mysql Data With LoadVars Object
retrieving mysql data with loadVars object
im trying to retrieve mysql data using the loadVars object.
having a bit of trouble though, it seems i can only access the data that gets loaded into the object from inside the object

ie)


ActionScript Code:
// create new load vars object
listVars = new LoadVars();
 
// send + load vars
listVars.sendAndLoad("get_emails.php", listVars, "POST");
 
listVars.onLoad = function (success) {
        if (success) {
                myArray = new Array();
                myArray = this.emails.split(",");
                _root.test.text = myArray;
        } else {
                gotoAndStop ("noemails");
        }
}


_root.test.text = myArray will print the array values in the text box on root...but i where to write that line outside the object like so:

_root.test.text = listVars.myArray;

it would print nothing.

i am confused about the targeting of the variables from within the loadVars object. it would be really handy if i could access those variables from any timeline but right now it seems as though it is impossible.

[CS3] Displaying Non-english Characters Loaded With LoadVars
I am making a website in Swedish. I have used LoadVars to load in variables for the text of the pages.

this is one of the variables the textfile contains

Quote:




&textPage1Sve=detta är på svenska.Detta är ett test för att se om ÅÄÖ visas korekt.




but it is incorrectly displayed in the flash movie. like this:

Quote:




"detta p�venska.Detta ett test ftt se om visas korekt."




the loading code is correct but the special swedish characters are not displayed correctly. (åäö)

Can anyone help me with this?

LoadVars Sending Data To PHP As Part Of A Loop... Changes Not Hitting MySQL
I've got a loop I'm running through assigning an array from an array of arrays to a set of variables and then sending those variables to a php script to update a mySQL db table. problem is, the changes are rarely going through to the db.

i'm assuming it's 'cause i'm swamping my php script. any suggestions? can i add some sort of return value that comes back from the php script allowing the loop to continue?

first time writing a flash app like this so any advice would be GOLDEN. thanks!

steve

Working With Non English Characters
Hi there,
anyone with experience working with non- english characters using OSX? The problem is to display dynamic text in foreign language specified in HTML within the actionscript. Please help-
Thanks
Lee Bosh

Special Characters Are Not Working
I'm using this code:


Code:
on (press){
System.setClipboard("u0104");
}
but it's still not pasting the correct symbol ( Polish letter). Any idea what I need to do in order to get it to paste correctly?

Can't Seem To Get Flash PHP MySQL Chat Working
Hey,
I can't seem to get my chat working. I keep getting the error "Error Connecting To Server" because thats my default error when the script fails but when I run the PHP script it works fine. The files can be downloaded here. Could I get someone to download them and look over them for me?

Thankz

Can't Seem To Get Flash PHP MySQL Chat Working
Hey,
I can't seem to get my chat working. I keep getting the error "Error Connecting To Server" because thats my default error when the script fails but when I run the PHP script it works fine. The files can be downloaded here. Could I get someone to download them and look over them for me?

Thankz

Working With Escaped Characters In Strings
Hey there, I am working with strings that need to retain the details of line returns as they were typed in and also characters such as speech marks (they will contain ascii art). I have looked at using the escape function but this doesn't seem to work--
ActionScript Code:
var myString:String = escape("
( ((
.. =
._\_ `-
(____))( ----
(____)) _
(____))
(____))____/----
Thumbs Up ");




I'm sure there's an easy way to do this without writing loads of conditions for checking the string and converting each character.
If anyone could point me in the right direction It would be a big help.
Thanks!
Schm

Actionscript Code Not Working - Connecting To MySQL
Hi,
I did a tutorial on how to connect a Flash Dynamic text box to a MySQL database. I created a PHP file which connects to the database and displays fine. The tricky part has been getting Flash to display the results in the PHP file. Here is my AS code. If anyone can see what I am doing wrong can you help please. Much appreciated.


Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += "<b>"+this["date"+e]+" - "+this["location"+e]+"</b><br><br>";
n.htmlText += this["comment"+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["date"+i]+" - "+this["location"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);

function loadArc(passed) {
arcNum = passed-1;
lv(entries_lv, entries_txt, undefined, arcNum, "../php/shows-query.php");
//for the large entry textfield
lv(entries_lv, entries_txt, undefined, 0, "../php/shows-query.php");
//for the archives text field
lv(archive_lv, archive_txt, "cycle", null, "../php/shows-query.php");


}

}

Thank you
Kay

Kirupa's Login Using Flash, PHP, And MySQL Not Working
I am recreating the .fla according to the tutorial INSIDE another .fla that is an accordion. Do I have to adjust the coding from the tutorial to do this -- I am worried that the _root references are not wrong.

Actionscript Code Not Working - Connecting To MySQL
Hi,
I did a tutorial on how to connect a Flash Dynamic text box to a MySQL database. I created a PHP file which connects to the database and displays fine. The tricky part has been getting Flash to display the results in the PHP file. Here is my AS code. If anyone can see what I am doing wrong can you help please. Much appreciated.


Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += "<b>"+this["date"+e]+" - "+this["location"+e]+"</b><br><br>";
n.htmlText += this["comment"+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["date"+i]+" - "+this["location"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);

function loadArc(passed) {
arcNum = passed-1;
lv(entries_lv, entries_txt, undefined, arcNum, "../php/shows-query.php");
//for the large entry textfield
lv(entries_lv, entries_txt, undefined, 0, "../php/shows-query.php");
//for the archives text field
lv(archive_lv, archive_txt, "cycle", null, "../php/shows-query.php");


}

}

Thank you
Kay

Working With A Tile Map Generated By A PHP/MySQL Backend
Hey, just wondering if anyone would have any advice for interacting with an RPG tile-map using a PHP-built map engine with Flash?

What The Pork? My Escape Characters Aren't Working
Hey there,

Can someone tell me if escape characters are supported when loading an external file? If so, can you show me what i should be typing to display the "&" and a bullet, i would appreciate it!

/n & /n?

Thanks...

Special Characters Not Working When Passed To Flash
I pass variables to flash from a php file:
.swf?data=café

but i urlencode this to:
.swf?data=caf%E9

But i can't get this text displayed correctly in flash. The special characters don't work. It becomes: caf

what I do wrong?

tanx

Swedish Letters
I've got a new problem and what better way to solve it then turning to ultrashock...

This is the problem: I have a text from a txt-file loading into a dynamic textfield, this works great but I'm having trouble displaying swedish letters (åäö).
The dynamic textfield is set to read as html... cos I thought I could just write the letters as html (&auml; , &ouml; and &aring but the problem is the rest of the text stops to load, probably because of the &...

does anybody have a solution to my problem?
Thanks in advance!

> Mysql - Php - Flash Frontend - Basket Isn't Working - Help Needed
dear guys n grrls

i have to build a shop system using mysql php and flash frontend! i'm a flash beginner but already coded some c++,assembler,php,mysql stuff and i 've made it to build selectable menus showing product groups and products.i now need help because the damn basket isn't working properly.

if you click on a product to add it into the basket flash push the product info into an array and start the mc basket. inside basket is a masked mc. this clip duplicate a input text row mc depending on the lenght of the product array.

// every copied clip is given a rownum.
something like:
for(cx<length_of_array_product;cx++){
_root.shop.basket.productmc.productrow.rownum = cx;
}

also i use a duplicator array to see if the product was choosen once or several times and to push a updated price (something like: (duplicator[cx]*price) into the duplicated product

//in every copied clip i need to read out a specific array
id = _root.shop.basket.id_array[rownum];
price = _root.shop.basket.price_array[rownum];

as i clicked on products to add them into basket the product was added but just neither the duplicator nor the price of product i could see on the screen. ;(

i have trouble with placing or timing or updating the mc and the scripts because it seems that the code cant't be so bad because if you click on more than 3 different products the code adds the products into basket and the it's finally showing the correct price.

i'm stucked . help is badly needed ... please, do you know a solution for my problem.
it's just that i'm sitting here for 2 days now in front of my computer and i can't get the #!$%*? code working properly. hope you can figure out what i tried to explain . sorry ... i live in berlin germany and my english still need a lot of practice!

see the running version on:

http://www.lutz22.org
pw: 2fat2****

thanx!
ANALoG

Problems With Alias Text When Working With Special Characters
Hi,

I always have the same problem with alias text... I work with spanish text and so I use special characters such as á, é, etc...
I don't have any trouble using é, ó and so on, but "á" transforms in "·"!!!
It must be a bug, because it is no different from the others...
Is there anyone who knows how to solve this bug?

Swedish Letters Problem
Hi! When i use external textfiles and Loads text into a dynamic textfield, swedish letters turns into strange symbols... How can i fix this? Is there special codes får the swedish letters like in HTML?

Compability For Swedish Chars
How do i make swedish characters work when loading text to a textfield from a txt-file??

Swedish Letters In Php To Flash
Hi, I'm new to flash vs php, but i have made some scripts working and i'm very happy.
But i have a problem, i've made a action script that communicates with a phpscript and back, sending e mail from flash, but when it sends and resieves i dont get the swedish characters in the text sent and resieved correctly, and it works perfekt in flash5 but not mx and 2004, i cant find the solution,,, helppp please

by the way i found the scripts in this flashkit tutorial and its great.... http://www.flashkit.com/tutorials/Dy...-658/index.php

Swedish Font Problems ÄÅÖ
Hey!
im using a form i made in flash to send variables to a MySql Database.
code for form:

ActionScript Code:
//trace(email1.text+", "+question1.text+", "+check1.selected);status1.textsend1.onPress = function () {    status1.text = "sending..";    var ld:LoadVars = new LoadVars ();    var reciever:LoadVars = new LoadVars();    ld.email1 = email1.text;    ld.question1 = question1.text;    ld.public1 = check1.selected;    trace (ld);    ld.sendAndLoad ('http://www.valj.nu/live/script/ny.php', reciever, 'POST');    reciever.onLoad = function () {                      trace("Recieved info -> "+reciever);        status1.text = "Sent!";             };               };

Its sends it perfectly well to the databse thru this page:

PHP Code:



<?
include("dbconnect.php");
$email = $_POST['email1'];
$question = $_POST['question1'];
$public = $_POST['public1'];
$question = stripslashes($question);
$email = stripslashes($email);
$sql = mysql_query("INSERT INTO nya (email , fråga , datum , publiceras)
        VALUES('$email', '$question', now(),'$public')")
        or die (mysql_error());
?>




however in the database if i have used the swedish letters ÄÅÖ äåö
it looks like this:

"hejsan
jag Heter VoS
Jag Är från Sverige
Öland..."

this is just a text i typed in one of the fields, its supposed to look like this:
"hejsan
jag heter VoS
Jag Är från Sverige
Å öland"

anyone abel to tell my why, and more importantly how i fix it?

thanks


//VoS

Cant Show Some Swedish Letters From The Xml
Hello,
I have a dynamic text and I embed uppercase, lowercase, numerals and punctuation and after that I added å ä ö Å Ä Ö from the "include these characters" but they doesn't show up in the flash..

this is how my xml look like:
<icons>

<icon image="icon1.png" tooltip="<tip text here>" content="<My text here>"/>

</icons>

Should I add something more?

Cant Show Some Swedish Letters From The Xml
Hello,
I have a dynamic text and I embed uppercase, lowercase, numerals and punctuation and after that I added å ä ö Å Ä Ö from the "include these characters" but they doesn't show up in the flash..

this is how my xml look like:
<icons>

<icon image="icon1.png" tooltip="<tip text here>" content="<My text here>"/>

</icons>

Should I add something more?

LoadVars Not Working.
Basically, I am trying to load dynamic content into Flash.

LoadVars seems to be loading into Flash but I cannot for the life of me use the loaded variables. I thought it would be a common problem but I found nothing in the archives.

Here's the function invocation:

code:
on (press) {
_root.activelink = 11;
_root.loadlink();
}
[/code]
And here is the rest of the code:
[code]
loadVariablesNum("vars.as", 0);
// loadVariablesNum("vars.as?Date=" add (Date.getYear+1900) add Date.getMonth add Date.getDate, 0);
_root.borderdepth = 200;
_root.menuxdest0 = 20;
_root.soundon = true;
smenu1 = new Sound(_root.smenu1);
smenu2 = new Sound(_root.smenu2);
smenu3 = new Sound(_root.smenu3);
smenu4 = new Sound(_root.smenu4);
smenu5 = new Sound(_root.smenu5);
smenu1.attachSound("sndmenu1id");
smenu2.attachSound("sndmenu2id");
smenu3.attachSound("sndmenu3id");
smenu4.attachSound("sndmenu4id");
smenu5.attachSound("sndmenu5id");
function loadlink() {
_root.output("begin now----------------");
_root.smenu2.start(0, 0);
if (eval("_root.typlink" add _root.activelink) == "vars") {
_root.contentloaded = false;
// unload current layout
_root.output("unloading content");
_root.unloadborders();
_root.unloadtextboxes();
_root.unloadpictures();
_root.unloadicons();
// load new layout
_root.varstoload = eval("_root.loclink" add _root.activelink);
_root.output("loading " add _root.varstoload);
_root.contentvars = new LoadVars();
_root.contentvars.load(_root.varstoload);
_root.contentvars.onLoad = _root.loadcontent();
// loadVariables(_root.varstoload, "_root.contentvars");
} else if (eval("_root.typlink" add _root.activelink) == "link") {
getURL(eval("_root.loclink" add _root.activelink), ("_root.winlink" add _root.activelink));
}
}
function unloadborders() {
_root.output("unloadborders");
for (amt=1; amt<=_root.contentvars.totborders; amt++) {
_root.output("removing border" add amt);
removeMovieClip("border" add amt);
}
}
function loadborders() {
_root.output("loadborders");
for (amt=1; amt<=Number(_root.contentvars.totborders); amt++) {
_root.output(amt);
_root.currentdepth++;
_root.attachMovie("border", "border" add amt, _root.currentdepth);
set("_root.border" add amt add ".wid", Number("_root.contentvars.widborder" add amt));
set("_root.border" add amt add ".hgt", Number("_root.contentvars.hgtborder" add amt));
setProperty("_root.border" add amt, _x, Number("_root.contentvars.xpnborder" add amt));
setProperty("_root.border" add amt, _y, Number("_root.contentvars.ypnborder" add amt));
}
_root.ouput(_root.border1.hgt);
}
function loadcontent() {
_root.output("loadcontent");
_root.output(_root.contentvars.loaded)
_root.contentpercent = _root.contentvars.getBytesLoaded()/_root.contentvars.getBytesTotal()*100;
_root.contentbytes = _root.contentvars.getBytesTotal();
_root.output(_root.contentbytes);
_root.loadborders();
}
function output(out) {
if (out !=undefined) {
_root.outputvar = _root.outputvar add "<BR>" add out;
trace(out);
}else{
_root.outputvar = _root.outputvar add "<BR>" add "*****Error*****";
trace("*****Error*****");
}
}




Many of the functions have not been written yet but do not affect anything as of now.



Here is the ouput:

Quote:




begin now----------------
unloading content
unloadborders
loading vars11.as
loadcontent
false
*****Error*****
loadborders






_root.contentvars.loaded == false but that doesnt make sense b/c the vars show this:


Quote:




Variable _level0.contentvars = [object #11, class 'LoadVars'] {
onLoad:undefined,
section:"------------------Menus---------
",
txttitle:"Homepage1",
end:"1",
totborders:"1",
xpsborder1:"200",
yxpsborder1:"250",
widborder1:"200",
hgtborder1:"100"
}




That also doesn't make sense b/c I wrote:

_root.contentvars.onLoad = _root.loadcontent();




So, the LoadVars is loaded but says it is not. onLoad doesn't work. _root.contentvars.getBytesTotal() == undefined. I cannot use any of the loaded variables.

http://www.djglacial.com/test/c22/v2/

^ .swf

Loadvars Not Working
Can anyone help me figure out why this is not working?

viewThreads();
dataLoader = new LoadVars();
function viewThreads() {
list = list+", viewThreads called";
dataLoader.load("viewforum.php");
dataLoader.onLoad = function(success) {
if (success) {
list = list+", dataLoader.onLoad = success";
buildThreads();
} else {
list = list+", dataLoader.onLoad = !success";
}
};
}

[F8] LoadVars Not Working (PHP)
Can anyone see something I am missing.

I have converted a Flash 5 to 8 code, but it's broke now.

This is my PHP - WHICH WORKS FINE in 5

Code:
<?php

include ('include.inc');

mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");

$mid=$mid-1;

$query = "SELECT * FROM book LIMIT $mid,1";
$result = mysql_query($query);

$name = urlencode(mysql_result($result,0,"name"));
$date = mysql_result($result,0,"date");
$url = mysql_result($result,0,"url");
$email = mysql_result($result,0,"email");
$msg = urlencode(mysql_result($result,0,"msg"));

print "&name=$name";
print "&date=$date";
print "&url=$url";
print "&email=$email";
print "&msg=$msg";

?>


Here is my Flash 5 that worked. It just read the file in and automatically loaded my text boxes.

Code:
loadVariablesNum("php/read.php", 0, "GET");


Now, here is my converted code to Flash 8 in 1st frame

Code:
var readFile:LoadVars = new LoadVars();
readFile.load("php/read.php", 0, "GET");
readFile.onLoad = function(success) {
if (success){
name = this["name"];
date = this["date"];
url = this["url"];
email = this["email"];
msg = this["msg"];
}
else {
// nothing
}
}


But, nothing shows up in my boxes.

Can someone tell me how loading a file and the first frame interacts with each other. When does the data load compared to the controls and visa-versa.

Why isn't my data showing up in my text boxes? I have the all the variables in the textboxes.

Thanks

LoadVars Not Working In Ie?
I'm working on a script that loads variables from a database and applys them to some thumbnails. So far it works fine in firefox and safari but not in internet explorer:

http://www.jimboready.com/playground/wpflash/?page=news (it might take a few seconds to load)

I had the same problem a while ago when I was loading external images into flash. Does anyone know why this is, or how I can work around it?

here's the code:


ActionScript Code:
var thumbnails = new Array();
l = new LoadVars();
l.onLoad = function() {
    for (i=0; i<this.n; i++) {
        thumbnails.push([this["post_name"+i], this["post_title"+i], this["meta_value"+i]]);
    }
    loadthumbs();
};
function loadthumbs() {
    for (j=0; j<thumbnails.length; j++) {
        clip.duplicateMovieClip(j, j);
        var curClip:MovieClip = this[j];
        curClip._y = random(300);
        curClip._x = random(300);
        curClip.caption = thumbnails[j][1];
    }
}
l.load("flash.php?cat="+category);
stop();

Many thanks,

- Jim.

LoadVars Not Working?
Hello everyone,
I am trying to load a .txt file from my website lets say www.example.com/main/sometext.txt
When I run the .swf on my computer, it does find the www.example.com/main/sometext.txt
When I run the .swf on my website,www.example.com/example.swf, it does find the www.example.com/main/sometext.txt
However, when I run the .swf on a different website lets say www.anotherexample.com/example.swf it doesn't work.. it doesn't find the www.example.com/main/sometext.txt
Does anyone have any idea why this is happening?

Thanks,
iloveisrael.

P.S. I am using AS. 2

LoadVars Not Working On PC
I decided to load dynamic text into a flash site using the loadVars function in flash AS2. This seems to work fine in Safari and Fire Fox on different macs but i seem to have a problem when it come to IE7 (sometimes 6) and Fire Fox on a PC - the box where the text is supposed to appear reads undefined when viewed in these browsers. I'm fairly new to flash. Does anyone know how to remedy this. Much help would be appreciated. THANK YOU in advance!

LoadVars() Not Working
My flash file loads variables from external text files. When I run the swf file as a stand alone player it works great. However, when I publish it with an html file and try to open it with the html file (from my local harddrive with all files in the same directory), the swf is unable to load the variables from the external text files.

Here is a segment of my code:
myConfig = new LoadVars();
myConfig.onLoad = function(success)
{
if (success)
{
///// Get Course Name variable from ini file /////
myCourseName = this.courseName;
///// Get copyright variable from ini file /////
myCopyright = this.copyright;
///// Get Lesson Title variables from ini file/////
myLessons = new Array();
myLessons = this.lessons.split(";");
///// Get page variables from ini file /////
totalContent = new Array();
totalContent = this.pages.split(";");
///// Get title swf variable from ini file /////
myTitleScreen = this.titleScreen;
///// Get disclaimer info from ini file /////
myDisclaimer = this.disclaimer;
///// Get overview info from ini file /////
myOverview = this.overview;
////////////////////////////////////////////////////
}
}
myConfig.load(path+"/config.ini");

LoadVars Not Working
Hi,

I've got a LoadVars object full of variables and need to use sendAndLoad to communicate with a script. The script is on another domain, so I'm wondering if this is causing the problems. In the onLoad event, success always = false. If i just use the send method and pop a window it always works. Can anyone advise me on how to solve this problem? I just need to send the variables, not load, but I also need to not pop a window. I have already used System.security.allowDomain() with no success. I read something about crossbrowser.xml but didn't understand how it works..

Thanks - Trevor

Swedish Signs Dosnt Work, Why ?
Hi every1.
i have a problem, again.
I have posted at the General flash gelp but the help i got ther didint help, so i'll try here.

I have a dynamic textbox witch i have some code in, i have a wordpad document with some text in, and it loads in the textbox.

But now i have this problem, when i publish the browser wont load swedish signs like Å,Ä and Ö. Why is that

i have checked the charahter options.

All charachters
i have tryed only lowecase uppercase, numerials, "and these characters"= ÅÄÖ

What am i doing wrong ?
I am using the font ARIAL witch includes the characters ÅÄÖ
An just for case i changed the font to arial in the wordpad document, witch shouldn have any effect relly...



What am i doing wroooongg ??

Copyright © 2005-08 www.BigResource.com, All rights reserved