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




Reading Php In Flash ?



why wont this work ?
I have two text boxes in flash caled text1 and text2
this is the actionscript in the flash file
lv.myText1 = text1;
lv.myText2 = text2;
lv.sendAndLoad ("flashphp_test.php", "POST");


this is the php file
<?

$variabel1 = "Test variabel 1";
$variabel2 = "Test variabel 2";

print "myText1=$variabel1";
print "myTest2=$variabel2";

?>



FlashKit > Flash Help > Flash ActionScript
Posted on: 12-10-2005, 02:41 PM


View Complete Forum Thread with Replies

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

Flash Reading ASP
ok i have an asp file that acts as a counter... it reads the number from a .txt file and the adds +1 to the number and stores the new number into the .txt

In my main movie i putted a dynamic textbox with variable name counter. In the action i have Loadvarnum("counter.asp",0) and im not getting the number??? how could i get the number to show?? thanks by the way

Reading An Url From Flash
hello, i am only a little experienced in flash, but i have spend a whole day looking for the answer which to me seems it should have quite a simple solution:

is there a way to read the url of an html page with the embedded flash movie?

the reason of this is that i am trying to set-up a bi-langual website in which i want to include a flash menu language switch button that reads the url, replaces EN with NL or vice versa and reloads it
example: you click on the english flag to reload the current page (in the local language). so the the flash button/script should read out the html page it is embedded in "www.mywebsite.com/page1_NL.html" switch "NL" in "EN" and load "www.mywebsite.com/page1_EN.html"is there any way to do it?

thank you in advance

Flash Reading Xml
Hello,

I'm a programmer, but new to flash so I'm hoping someone can point me in the right direction.

I want a swf movie to read an xml file that contains a string of characters. I need the characters to be read one at a time (with about 1 second between each read) and an action will be performed depending on what the character is.

Is there better terminology I can use to search google for this? Can someone point me to some tutorials that will help me start this?

Help Reading XML To Flash
Hey everybody... i'm stuck again.... maybe you guys can help and tell me what the problem is:

i have this PHP file that creates a perfect XML from MySql... at least i can see it on my browser.

The problem comes when i try to load that info into flash... it says something like undefined on the dynamic text field.

this is my PHP file:


Code:
<?

$link = mysql_connect ("localhost", "admin", "admin");
mysql_select_db("comdo_noticias");

$query = 'SELECT * FROM deportes ORDER BY Id DESC LIMIT 1';
$results = mysql_query($query);

echo "<?xml version="1.0"?>
";
echo "<deportes>
";

while($line = mysql_fetch_assoc($results)) {
echo "<noticia>
";
echo "<fecha>" . $line["fecha"] . "</fecha>
";
echo "<titulo>" . $line["titulo"] . "</titulo>
";
echo "<firma>" . $line["firma"] . "</firma>
";
echo "<mensaje>" . $line["copy"] . "</mensaje>
";
echo "<imagen>" . $line["imagen"] . "</imagen>
";
echo "</noticia>
";
}

echo "</deportes>
";

mysql_close($link)

?>
and this is my actionscript on CS3


Code:
System.useCodepage = true;

var indice:Number;
var deportes_xml:XML;

function cargarDatos(_indice:Number) {
var fecha:String;
var titulo:String;
var firma:String;
var mensaje:String;

fecha = deportes_xml.firstChild.childNodes[_indice].attributes.fecha;
titulo = deportes_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
firma = deportes_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue;
mensaje = deportes_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue;
_root.deportes_txt.htmlText = "";
_root.deportes_txt.htmlText += "<p align='left'><font color='#ffffff' size='10'><b>"+titulo+"</b></font></p>";
_root.deportes_txt.htmlText += "<p><font size='8'>"+mensaje+"</font>";
_root.deportes_txt.htmlText += "<font color='#ffffff' size='10'>Publicado: "+fecha+"</font></p>";
}

indice = 0;
deportes_xml = new XML();
deportes_xml.ignoreWhite = true;
deportes_xml.load("prueba/php_deportes.php");
deportes_xml.onLoad = function() {
cargarDatos(indice);
};

Reading A PDF Via Flash
Hey all,
Is there any integration between flash (as 2.0) and PDF type documents? Is there any way to read a PDF inside of Flash? I'm assuming the answer is no, but hey, anything is possible. If all else fails, I could just read in a .png file in its place.

Flash Reading XML
Hello,
I was able to write a flash file to read a local XML file, parse it and display the content.

However i need to write one now which loads a web service (an xml file on my other server). How can i do this?

i used
headlineXML = new XML();
headlineXML.onLoad = myLoad;
headlineXML.load("bbb.xmll");

in my first program and it worked.. but when i put a full URL (http://www.aaa.com/bbb.xml) it keeps saying failed to open URL even tho the file is there!

Cheers

Help Reading ASP Variable In Flash
i have an asp page that sets a cookie value. i need to be able to read this variable in flash and perform an action based on the value of this variable. i can correctly call the asp page through flash. part of my asp code is below...

if Request.Cookies("values")="" then ' do below if particular cookie does not exist on the browser

Response.Cookies("values").expires=dateAdd("y",1,d ate) 'set cookie expiration to 1 year

Response.Cookies("values")("firstTime")="yes"
varNew=Request.Cookies("values")("firstTime")

Response.Write "&firstTime="& Server.URLEncode(varNew) ' last 3 lines set cookie key "firstTime" to yes
' and write a url encoded string to the browser
' so Flash can retrieve the variable


in the browser window this gives me the result...

&firstTime=yes


when i play my flash movie and use the "list variables" function, i see that the asp page has placed the variable on the root and it looks like this...

Variable _level0.firstTime = """


shouldn't the value of Variable _level0.firstTime be yes?

can anyone tell me what i am doing wrong???

Reading The XML ChildNodes From Flash...
Hi,

Can somebody give me a 'clear' explanation of reading 'this' XML file;

< TUTOR >
< RECORD >
< FIELD >
< VALUE >400< /VALUE >
< /FIELD >
< /RECORD >
< RECORD >
< FIELD >
< VALUE >900< /VALUE >
< /FIELD >
< /RECORD >
< RECORD >
< FIELD >
< VALUE >1000< /VALUE >
< /FIELD>
< /RECORD >
< /TUTOR >

from Flash and putting those data to variables in Flash like

movienumber1=400
movienumber2=900
movienumber3=1000

I am really confused because of the 'childNodes' numbers... I could not understand how the childNode numbers are increasing...

Thank you...

Reading Querystrings In Flash
hello..i am calling an swf like this : xxx.xx.com/FILE.swf?song=firstSong

how can i read this variable song in the flash movie and display it in a dynamic textfiled?????

Reading And Writing From Flash?
Is there any other ways of reading out of and reading into Flash other that using cookies?

What i have is a series of pages in a page-turner type tuturial and on one of those pages is a Flash piece that the learner does a small drag and drop activity. What I need is for the piece to remember where the learner dragged the items. Even when they continue on and the the Flash piece is unloaded because the tutorial has backwards navigation.

Cookies are an obvious one but not all comps use cookies and I need a more secure solution. Is it possible to use Javascript within Flash to write out the variables to the Javascrpt shell that runs the tutorial? Can Flash read and write from LMS's? (I highly doubt is but ya never know) Any help would greatly appreciated!

Reading PHP Variables From Flash
Can anybody give me an example how can read two variables from a link sended in a PHP script via GET.

Let me be more specific:

Supose I have a page index.php and I have a varible name lang. Well the lang could be en, fr, de or any other language in the world. So I have a small flash movie wich have links to other php pages on my site, but I realy need to send that pages the variable lang that a visitor is choosing in index.php page.

If anyone can give me an example about how can I only display a variable and it's value in the flash movie according to the one send by the script.

Reading Cookies In Flash
I can't seem to get the flash movie to read the cookie. I am trying to add a high scores list to a game "snake." On my site, users are logged in, and their username is stored in a cookie. I have a javascript code which reads the cookies, and then passes them to the flash movie, when it's called through the EMBED tags.

Here's my javascript:

Code:
<script LANGUAGE="JavaScript1.1">
<!--
// Get Cookies script
cookString = "?"
// does the visitor have a cookie?
if(document.cookie != "") {
theCook = document.cookie.split("; ")
// add each part of the cookie to a string variable
for (i = 0; i < theCook.length; i ++) {
cookString += theCook[i] + "&"
}
}
// -->
</SCRIPT>

Then, it prints the variable cookString at the end of the src="snake.swf" in EMBED, so that the variables are passed to the flash movie.

Next, the flash passes all of it's variables to my submit.php , which stores the score in a database. But the "username" doesn't appear when I try to call it in my php script.

This makes me think that the flash file didn't get the username cookie variable in the first place. Can anyone see what's wrong? I'm no flash expert, but I can edit the action script because it's fairly simple. Alright, thanks for your time.

Reading In From A Dropdown In Flash...
Okay im doing a basic flash menu driven interface for a module.. and ive hit a problem...


Ive ask a user to enter there name so that it can be used later on in a certificate at the end of a quiz.

It Reads username + " has completed the quiz" (this bit works fine)

Now my main problem is on the same frame where the user enters there name, there is a drop down when they state if they are a boy or girl.... i wanted to use this later on the certificate frame to contiue the above so it says:

he (or she) " has a score of"

But i dont have a clue how to do this.. help!!!!!!

Reading Encrypted XML In Flash
Hello There,

Is there any way to encrypt and decrypt XML documents in Flash.

Firstly the pure XML has to be encrypted using any encrypt/decrypt code, so that these files can be distributed with FLASH PROJECTOR in CD-ROMS

Secondly, when flash reads these encrypted xml files, it has to decrypt using the same encrypt/decrypt code. then display the data

Any help

Thx in advance

Kaf

Reading Encrypted XML In Flash
Hi

Anyone, have codes to read Encrypted XML in Flash, it should decode and then display results. I need code to encrypt XML and to decrypt it in FLASH

Thx

Reading Encrypted XML In Flash
Hi All,

I am reading an encrypted xml file in flash. Although i can decrypt the data in flash. But it only recognize and read one element.

XML file has elements with encrypted attributes, which element has many child elements. I am able to read the root element encrypted attribute, but not any child element. Infact flash does not recognize or read child elements.

RootElement.childNodes.length returns "1", where as it has many child elements with encrypted attributes.

Any help is APPRECIATED IN ADVANCE

KAF

Reading Variables Into Flash (swf)
Is there anyway i can pass a variable in to a swf file before it loads or while it is playing and can i change this variable while it playing. For eg

Just say a user logs into a site and i want their name(variable) to be read by the swf file, so i can do some cool effects with their name.
either version 5 or 6

Thanks a million!

Reading Txt File From Flash?
If somebody could please help me with my problem, I'd be so happy, I'm new at this.

I currently have an HTML news page that reads the news via PHP from a text file. The php code is below. I want to have that page do that SAME exact thing, but in Flash! How?!?

<?php
$fd = fopen ("txtlist/news.txt", "r");
$content = fread ($fd, filesize ("txtlist/news.txt"));
fclose($fd);

$line = explode(";;", $content);
echo "<table cellpadding=4 cellspacing=9>";
foreach ($line as $lines) {
if ($lines) {
$linestr = explode(";", $lines);
$date = $linestr[0];
$body = $linestr[1];
echo "<tr>";
echo "<td align=center><b>$date</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>$body</td>";
echo "</tr>";
echo "<tr>";
echo "</tr>";
echo "<tr>";
echo "</tr>";

}
}
echo "</table>";
?>
</p>

Flash Site Not Reading On A Mca
the site
onsiteresearch.com will not read properly
on a mac the text comes out un aligned
and askewed . I am sure it has something
to do with the mac reading the html file. Is
there a javascript I can include so the site
will be compatable for mac/pc....the mac
is runnning windows not netscape
thanks
Gillian

Reading Code From Outside Flash?
Can you write code in a text editor like Notepad. Then have flash load those classes. Or must everything be typed in a frame or object?

TIA Dizz

Reading XML Data Into Flash
I have FlashMX 2004 Professional and I was wondering if there was a way to load xml data into flash without using the "nextchild" or "nextsibling" commands. What I was wondering is, is there a way to just tell it to pull what's between say the "name" tag. For example:

<Person>
<Name>Jane Doe</Name>
<Job>Garbageman</Job>
</Person>

I was hoping there was a way to tell it to just grab what's between the <Name> tags. Right now I'm going through it with the nextchild/nextsibling/etc commands and then having to using string manipulation to remove the start and end tags cause it pulls those too. It just seems kinda weird to me, cause I'm not interested in pulling in the meta data, just the data.

Flash Not Reading Variable
Hi guy

check out this link
http://64.13.207.72/eCard/bp/readCar...=ndd1212835794

the m=ndd1212835794 should be read by my flash file, but for some reason, it not doing so now.


when u view source
it show embed src="card.swf?&m="
which mean the variable is not pass to the html at all also.

How do we solve this problem?


Thanks in advance

[F8] Reading Cookies In Flash
This is a very stupid question.

If I create a cookie on a php form page and then go to a page with flash content on it can I get the value of that cookie using Shared objects in the flash movie?

Cheers
Matt

Reading PHP Variables In Flash
Hi..

Im wondering if it is possible to display the results of a PHP variable in flash?

for example... a very simple PHP variable could be


PHP Code:



$simple = "Simple Text";




How would I display this variable in Flash?

Flash Writing And Reading A Db With Php
Hi,
I need to write a new xml node every click (mouse down) or to add elements to an array...
any suggestion?

thanks,
J

Flash Not Reading $_GET
PHP / HTML

"slide_number" comes back as "Undefined" in flash



Code:
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '759',
'height', '386',
'src', 'pre-loader',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'pre-loader',
'bgcolor', '#ffffff',
'name', 'pre-loader',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', '<?= base_url(); ?>flash/pre-loader',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="759" height="386" id="pre-loader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="<?= base_url(); ?>flash/pre-loader.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="<?= base_url(); ?>flash/pre-loader.swf" FlashVars="slidenumber=<?= $_GET['slide_number']; ?>" quality="high" bgcolor="#ffffff" width="759" height="386" name="pre-loader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>


Flash:

Code:
var SlideInfo = new LoadVars();
SlideInfo.number = _root.slide_number;

Reading Data From Flash..
Hi,

I have this data in text.txt file.

&text=1
&text=3
&text=5

I found out that when I tried to access/read the data from flash, it will only read the last one: &text=5.. how to make it read the three data?

Reading Xml Declartion Tag From Flash?
Hi all,

i have the following xml file:
<?xml version="1.0" ?>
<book>
<part id="part01">
<?docpage num=pg1?>
<title>Foundation</title>
<?docpage num=pg2?>
<subtitle><emphasis role="strong">CASE STUDY:</emphasis></subtitle>
<chapter id="ch01">
<?docpage num=pg5?>
<title>Title of the book</title>
<?docpage num=pg6?>
<para>The task of securing .......</para>
<para>Unlike many other books .....</para>
<para>A professional, skilled attacker ..........</para>
<para>As a person responsible .........</para>
<para>In addition, to use many of the .....</para>
<para>In this chapter, we try to correct .....</para>
</chapter>
</part>
</book>


all the contents of the book are translated into xml like above.

My problem is. according to the page no given in the following instruction tag

<?docpage num=pg1?>

i have to search above tag and display all the data upto next instruction tag

please tell me how to search data in xml using flash.

regards
Advika

Reading Xml Nodes Into Flash
Hi,

I am working on a flash/zinc app that needs to read in numerous xml values from the example code:
Code:

<region>
<birmingham>
<ac1>
<a1>data 1</a1>
<a2>data 2 </a2>
<a3 />
<a4 />
</ac1>
<ac2>
<a1>data 1</a1>
<a2>data 2 </a2>
<a3 />
<a4 />
</ac2>
</birmingham>
</region>
I can input the first value by using -
Code:
_root.a1.text = datafXML.firstChild.firstChild.firstChild.firstChild.firstChild
But how do I access the other data in that node and then the data in the second (ac2), third (ac3) and so one...

Hope somone can help.

Thanks,
Phil

Flash Not Reading PHP Files
I have been trying to create an authentication system using PHP5+, MYSQL 5+ and APACHE2+ using Actionscript3. When I got the codes together my password and usernames would not check against the MYSQL database, so I tried changing the code to then just obtain the passwords straight from the PHP files. I was just trying something different as I had been tearing my hair out over this and to my surprise even this did not work. I am new to this so I might need some correcting, but I did not see any errors in this. Can you guys help me.
Also when I directly write php code to insert data into the MySQL database but when I run that code through actionscript it fails to work.

Thanks in advanced.

Here is my php codes:

---------logincheck------------------------------------------------------

<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];


if($username == "admin" && $password == "password"){
$_SESSION['loggedIn'] = true;
echo 'login=success';
}else{
echo 'login=failure';
}
?>


-------------------------members php-------------------------------------------------------

<?php
session_start();
//check if the loggedIn session has been really set so that noone can access this page directly. If it is not set send him to login page
if(!isset($_SESSION['loggedIn'])){
header("Location: login.html");
exit();

}
?><style type="text/css">
<!--
body {
background-color: #333333;
}
.style1 {
color: #FFFFCC;
font-weight: bold;
}
-->
</style>
<span class="style1">
Congratulations you are now in the upload area</span>

-----------------------------------and finally the actionscript code just in case:--------------------------------------

tError.autoSize = "right";

var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();

mcLogin.onRelease = function() {
lvSend.username = tUsername.text;
lvSend.password = tPassword.text;
lvSend.sendAndLoad("logincheck.php", lvReceive, "POST");
};

lvReceive.onLoad = function(success:Boolean) {
if (success) {
if (this.login == "success") {
getURL("members.php");
}else{
tError.text = "I'm sorry you did not enter valid login details";
}
} else {
trace("no reponse from server");
}
};

Reading A CSV File In Flash
I want to read a CSV file in ActionScript and this file will help me to create some array from the data it contains. I googled around but everything i found was related to XML. I want to read CSV. Any Solution ?

Reading RSS Items In Flash. HELP.....
Hi there,
im still trying to get my latest topics from phpbb to display in my flash website.
i have now sorted out an RSS feed so it displays the items i need.
CLICK ME!! RSS
how do i get flash to read and display just the thread topics and have them hyperlinked to the post???
i am a newbe with RSS i have never touched it before and im pretty lost!
am i on the right tracks?
PLEASE HELP!!!

Can Be Flash Reading By Robots?
Hi,

I understood that the new flash format files (CS3) have a XML layer can be read by robots or any textual browser for automatic process? it's true ? how can request this xml from the server?

Saving And Reading In Flash
hi all,

im roshan kolar. I have a question. I have a flash page with input text fields. When i enter the data into it and click save button, the data needs to be written to a text file. later i want to read the text file and get the data in the same text field. can i do it without using any third party programmin technique like perl, php, cgi, etc..?

please.

Reading Flash Using Javascript
Is it possible to use JavaScript to detect changes in a Flash movie and retrieve the infromation that is displayed on screen at that time as is done with screen readers?

Flash Reading Html
Hello I am making a couple of flash toys in which info for each different flash toy is stored in a database (eg for a quiz game the questions are stored in the db) and I was wondering if there is a way to let flash "read" some of the html it is embedded in (for instance a code) which then can be used to access that codes set of info (like the questions for a quiz game)
Please help me out, and having an external text doc is not an option (unless flash can be compiled on the go to actually change the path of the txt.)

Binary.Boy

[CS3]Reading Cookies In Flash.
I'm interested in being able to read a single variable from a cookie i am writing using JS.
How can i retrieve that data in Flash? I've already read this but i'm not so sure it would work and it's too complicated for what i need. Is there any simpler way?
Thanks in advance.

Flash Reading Url Variables
i want my flash to be able to read the url's variable so that my flash will appear accordingly to what the user specify.
so far example, i have this url, http://www.mywebsite.com/enter.php?o...ne&option2=two
how do i code in the actionscript to read the option1 and option2 variables from the url?
thanks

Reading GET Variables From Flash.
Does anybody know how I can read the GET variables from flash?
Eks. How do I read var1 and var2 from flash when called with www.domain.com/flashSite.html?var1=1&var2=2 ???

Flash Reading PhP: Receives '-' But Not '+'
Does anyone know why when using a php script and echo'ing something, which flash picks up, flash doesn't "see" the character '+', but it does see '-' and '/' and so on?

I know it's a problem on flash's end, as the php does echo '+' fine. Also, is there a way to work around this problem?

Reading Xml In A Flash Textbox
hello all.

i have an xml file that i'm reading into a textbox in flash. (learned how to do that here at kirupa!) now i need the information in the xml file to be linkable from the flash frontend. what i'm looking for is the user to have the ability to click on a name (in the xml file) and go to a url. i don't know a lot about xml but i know that i tried to add an <a herf""></a> in the xml file and it didn't show up in flash.

forever learning...always humbled

Xml In Flash Reading Problem
im new at this im starting to learn i manage to learn from the tutorial called Displaying XML Data in Flash but theres some data from the xml that the flash doesnt want to read thsi is the xml http://www.teamwarfare.com/xml/viewt...cal+Operations the line that i want to display are the ones like ladder name, rank, win, losses, forfeits, match, status of each ladder the only lines that i have been able to display are the team information like name, email, status and founder.i dont know what to do to make those other lines to show this is the code im using
Code:
function loadXML(loaded) {
if (loaded) {
_root.team = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.email = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
_root.stat = this.firstChild.childNodes[0].childNodes[4].firstChild.nodeValue;
name_txt.text = _root.team;
comment_txt.text = _root.email;
status_txt.text = _root.stat;
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("<A href="http://www.teamwarfare.com/xml/viewteam_v2.asp?team=Assassin+Tactical+Operations");[/code" target=_blank>http://www.teamwarfare.com/xml/viewteam_v2.asp?team=Assassin+Tactical+Operations");
im trying to change this lines
Code:
_root.team = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
_root.email = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
_root.stat = this.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
to make it show the line that i want but i dont know y it doesn work if some one can help me it will be apreciated thx.

Flash Not Reading Variable
Hi guy

check out this link
http://64.13.207.72/eCard/bp/createCard/index.htm

the m=ndd1212835794 should be read by my flash file, but for some reason, it not doing so now.


when u view source
it show embed src="card.swf?&m="
which mean the variable is not pass to the html at all also.

How do we solve this problem?


Thanks in advance

Reading An RSS Feed In Flash AS2.0
I'm trying to read my most recent post from my blog into my flash movie. It seems to work, but sometimes it's delayed, and sometimes it doesn't load at all. Here is my code. If someone can take a look and give me some direction I would be very helpful.

P.S. I'm kind of a newbie to flash still, so my code is probably very messy/inefficient, if anybody has any tips overall, that would be great!


Code:
//this will contain all the event details from the xml file
var titleArray:Array = new Array();
var linkArray:Array = new Array();
var descriptArray:Array = new Array();
var dateArray:Array = new Array();
var rssTotal:Number;

//create the XML object and populate with event details
var rssXML:XML = new XML();
rssXML.ignoreWhite = true;
var rssRootNode:XMLNode;

rssXML.onLoad = function(success:Boolean) {
if (success) {
rssRootNode = this.firstChild.firstChild;
rssTotal = rssRootNode.childNodes.length;

titleArray.push(rssRootNode.childNodes[6].childNodes[0].firstChild.nodeValue);
linkArray.push(rssRootNode.childNodes[6].childNodes[1].firstChild.nodeValue);
dateArray.push(rssRootNode.childNodes[6].childNodes[3].firstChild.nodeValue);
descriptArray.push(rssRootNode.childNodes[6].childNodes[7].firstChild.nodeValue);

populateBlog();
} else {
trace("error loading xml file");
}
};
rssXML.load("http://mav-media.com/blog/?feed=rss2");

function populateBlog():Void {
oldString = dateArray[0];
oldString = oldString.split("2008")[0];

content_mc.body_mc.blog_mc.title_txt.htmlText = "<b>"+titleArray[0]+"</b>";
content_mc.body_mc.blog_mc.desc_txt.htmlText = descriptArray[0].truncate(340);
content_mc.body_mc.blog_mc.date_txt.htmlText = "<b>"+oldString+" 2008</b>";
}

content_mc.body_mc.preloader_mc.onEnterFrame = function() {
content_mc.body_mc.blog_mc._alpha = 0;
var todo:Number = rssXML.getBytesTotal();
var done:Number = rssXML.getBytesLoaded();

if (todo == done) {
trace("XML LOADED");
TweenFilterLite.to(content_mc.body_mc.blog_mc,.3,{_alpha:100});
delete this.onEnterFrame;
this._visible = false;

} else {
if (todo) {

content_mc.body_mc.preloader_mc.mask_mc._xscale = (Math.round(100/todo*done));
trace(content_mc.body_mc.preloader_mc.mask_mc._xscale);
}
}
};

Flash Reading Url Variables
i want my flash to be able to read the url's variable so that my flash will appear accordingly to what the user specify.
so far example, i have this url, http://www.mywebsite.com/enter.php?o...ne&option2=two
how do i code in the actionscript to read the option1 and option2 variables from the url?
thanks

Reading GET Variables From Flash.
Does anybody know how I can read the GET variables from flash?
Eks. How do I read var1 and var2 from flash when called with www.domain.com/flashSite.html?var1=1&var2=2 ???

Flash Reading From COM1
Hey,

I have a question...can Flash connect and read information from the COM1 port of a PC? I am doing my senior project in school and I cannot find info on this topic, so I decided to ask the knowledgible people of SitePoint...

Flash Not Reading Variable
Hi guy

check out this link
http://64.13.207.72/eCard/bp/readCar...=ndd1212835794


the m=ndd1212835794 should be read by my flash file, but for some reason, it not doing so now.


when u view source
it show embed src="card.swf?&m="
which mean the variable is not pass to the html at all also.

How do we solve this problem?

Flash Isn't Reading The XML Properly?
Hi, I'm new here and a pretty big noob when it comes to flash though I am eager to learn. I followed your mp3 player tutorial and it seemed to work perfectly. However when i tried to put the player on my Myspace, it seems to not be able to read the XML file as song and artist name are both "Undefined". All the files are hosted on a Mediamax account within the same folder. Here are all the parts of code that make up the mp3 player:

mp3player.as
Code:

// Setup sound object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(100);

// Array of songs
var sa:Array = new Array();

// Currently playing song
var cps:Number = -1;

// Position of music
var pos:Number;

// Load the songs XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
   var nodes:Array = this.firstChild.childNodes;
   for(var i=0;i<nodes.length;i++)
   {
      sa.push(new Song(nodes[i].attributes.url, nodes[i].attributes.artist, nodes[i].attributes.track));
   }
   playSong();
}

xml.load("http://www.mediamax.com/rex7777/Hosted/Songs.xml");

// Play the MP3 File
function playSong():Void
{
   s = new Sound();
   s.onSoundComplete = playSong;
   s.setVolume(100);
   mute.gotoAndStop("on");
   if(cps == sa.length - 1)
   {
      cps = 0;
      s.loadSound(sa[cps].earl, true);
   }
   else
   {
      s.loadSound(sa[++cps].earl, true);
   }
   trackInfo.text = sa[cps].artist + " - " + sa[cps].track;
   playPause.gotoAndStop("pause");
   textPos = 0;
}

// Pauses the music
function pauseIt():Void
{
   pos = s.position;
   s.stop();
}

// Pauses the music
function unPauseIt():Void
{
   s.start(pos/1000);
}

// Music Controls

// Play/Pause Toggle
playPause.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("pauseOver");
   else this.gotoAndStop("playOver");
}

playPause.onRollOut = playPause.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("pause");
   else this.gotoAndStop("play");
}

playPause.onRelease = function()
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("playOver");
      this._parent.pauseIt();
   }
   else
   {
      this.gotoAndStop("pauseOver");
      this._parent.unPauseIt();
   }
}

// Next Button
next.onRollOver = function()
{
   this.gotoAndStop("nextOver");
}

next.onRollOut = next.onReleaseOutside = function()
{
   this.gotoAndStop("next");
}

next.onRelease = function()
{
   this._parent.playSong();
}

// Mute Button
mute.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("onOver");
   else this.gotoAndStop("offOver");
}

mute.onRollOut = mute.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("on");
   else this.gotoAndStop("off");
}

mute.onRelease = function()
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("offOver");
      s.setVolume(0);
   }
   else
   {
      this.gotoAndStop("onOver");
      s.setVolume(100);
   }
}


Songs.xml
Code:

<?xml version="1.0" encoding="UTF-8"?>
<songs>
   <song url="http://www.mediamax.com/rex7777/Hosted/What%20a%20Way%20to%20Spend%20My%20Weekend.mp3" artist="Donnie Brasco" track="What a Way to Spend My Weekend" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Yashin/Yashin%20-%20Mr%20Hyde%20%20rough%20mix.mp3" artist="Yashin" track="Mr Hyde" />
   <song url="http://www.mediamax.com/rex7777/Hosted/In%20Flames%20-%20Come%20Clarity%20%5B2006%5D/04-Dead%20end.mp3" artist="In Flames" track="Dead end" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Mexico%20Fallz/Nintendo%20Song.mp3" artist="MexicoFallz" track="Nintendo Song" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Skillet/Comatose/Skillet%20Comatose.mp3" artist="Skillet" track="Comatose" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Colon%20Open%20Bracket/Colon%20Open%20Bracket%20-%20Heartache%20Of%20Soccer%20Moms.mp3" artist=":(" track="Heartache of Soccer Moms" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Eyes%20set%20to%20kill%20-%20reach/09-eyes_set_to_kill-give_you_my_all.mp3" artist="Eyes Set to Kill" track="Give You my All" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Handshakes%20and%20Highfives/Losing%20the%20Touch.mp3" artist="Handshakes and Highfives" track="Losing the Touch" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Sienna%20Skies/To%20All%20Aspiring.mp3" artist="Sienna Skies" track="To All Aspiring" />
   <song url="http://www.mediamax.com/rex7777/Hosted/My%20Received%20Files/All%20Forgotten%20-%20At%20A%20Guess%20I%27m%20Second%20Best.mp3" artist="All Forgotten" track="At A Guess I'm Second Best" />
   <song url="http://download-v5.streamload.com/ea3ec201-eb72-47d3-a66a-f9335ed30d8f/rex7777/Hosted/Stone_Sour-Come_What(Ever)_May-(Special_Edition)-2007-uF/12-stone_sour-zzyzx_rd..mp3" artist="Stone Sour" track="Zzyzx Rd" />
   <song url="http://www.mediamax.com/rex7777/Hosted/InMe/InMe%20-%20Drain%20Me.mp3" artist="InMe" track="Drain Me" />
   <song url="http://www.mediamax.com/rex7777/Hosted/F.A.T.E/The%20addiction/03%20Contrived%20Conformity.mp3" artist="F.A.T.E" track="Contrived Conformity" />
   <song url="http://www.mediamax.com/rex7777/Hosted/PAIGE/Dear%20Heartstrings.mp3" artist="PAIGE" track="Dear Heartstrings" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Fei%20Comodo%20-%20Watch%20Them%20Feed.mp3" artist="Fei Comodo" track="Watch Them Feed" />
   <song url="http://www.mediamax.com/rex7777/Hosted/Madina%20Lake%20-%20From%20Them%20Through%20Us%20To%20You%20%5B2007%5D/12-madina_lake-true_love.mp3" artist="Madina Lake" track="True Love" />
</songs>

Song.as
Code:

class Song
{
   public var earl:String;
   public var artist:String;
   public var track:String;
   
   public function Song(e:String, a:String, t:String)
   {
      earl = e;
      artist = a;
      track = t;
   }
}

and this is the code that embeds the flash into my Myspace page (the flash loads fine and is visible, it just doesn't work properly )
Code:

<object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height="125" width="322" data="http://www.mediamax.com/rex7777/Hosted/mp3Player.swf">
  <param name="allowScriptAccess" value="never" />
  <param name="allowNetworking" value="internal" />
  <param name="movie" value="http://www.mediamax.com/rex7777/Hosted/mp3Player.swf" />
</object>

A big thanks to anyone who can help me with this,
-Rex

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