Groups | Blog | Home
all groups > flash actionscript > january 2005 >

flash actionscript : asp.net | actionscript


visualstylee
1/30/2005 8:23:39 PM

any sugesstions on why this doesn't work properly?

//heres the actionscript

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
myLoad = new LoadVars();
myLoad.load("/beta/menu.aspx");
percentloaded = myLoad.getBytesLoaded()/myLoad.getBytesTotal();
myLoad.onLoad = function(success) {
if (success) {
_root.mc1.gotoAndStop(2);
if (var0=="flash") {
textbox1.text = "yes";
} else {
textbox1.text = "no";
}
if (var1="jesse") {
textbox2.text = "yes";
} else {
textbox2.text = "no";
}
textbox1.text += " --- " + unescape(this);
} else {
_root.mc1.gotoAndStop(3);
}
};

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::
//here's the asp.net

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="menu.aspx.vb"
Inherits="fatal1ty.menu"%>
<%
Option Explicit
Dim var(3), i, count

i = 0
count = 3

var(0) = "flash"
var(1) = "jesse"
var(2) = "Nod"

Do While i < count
Response.Write "var" & i & "=" & var(i) & "&"
i = i + 1
Loop

Response.Write "i=" & i
%>
Laiverd.COM
1/30/2005 9:38:47 PM
Some elaboration on what doesn't work would be nice.

John

visualstylee
1/30/2005 9:39:23 PM
oh yea sorry,
there are 3 text fields on the _root, one frame and actions and a movie
clip called mc1 the movie clip on success does do what its told, but the text
fields do nothing. i want the text fields to display variables from the aspx
document
visualstylee
1/30/2005 10:33:17 PM
menu=&onLoad=%5Btype%20Function%5D

thats what it traces.. see i'm not exactly an actionscript master yet so i
dont really know what its telling me, i just know that its a string of variables
menu= nothing? & onload= ?
Laiverd.COM
1/30/2005 10:56:06 PM
try a trace(this) in the onLoad eventhandler, and check if that is what you
expect.

John

Laiverd.COM
1/30/2005 11:46:02 PM
In that case there's something wrong with the asp and the way you're sending your vars from the asp file to Flash. I'm definitely
not a master at asp, but will give you a similar setup for php.

<?
$myVar="val of myvar";
$yourVar="val of yourvar";
# then echo; in asp that would be response.write(whatever) I think
echo "&myFlashVar=$myVar&yourFlashVar=$yourVar&";
?>

The ampersand are there to differentiate the different variables from eachother; Flash needs them.

If done properly the trace in Flash should output something like:
myFlashVar=val of myvar&yourFlashVar=val of yourvar

Hope this helps.

John

--
---------------------------------------------------------------------------------------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
---------------------------------------------------------------------------------------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
---------------------------------------------------------------------------------------

AddThis Social Bookmark Button