all groups > flash data integration > april 2006 >
You're in the

flash data integration

group:

noob question: loading variables from an asp file


noob question: loading variables from an asp file andyburgess
4/12/2006 4:27:34 PM
flash data integration:
hi,

im totally new to flash 8 and am currently trying to get flash to draw some
information via a variable on an asp page already created.

when i type the following at the bottom of the page where all the queries
etc...
<%
Response.Write("myvariable=" & StationName)
%>


this is what i get

myvariable=Brackley MOT & Service Centre

So from that I obviously want to have the 'Brackley MOT & Service centre' to
be displayed on my flash movie.

I have a basic flash movie setup which works fine. a text box called myText_txt
This is the actionscript used in frame one

myData = new loadvars();
myData.onLoad = function(){
myText_txt.html = true
myText_txt.htmlText this.myvariable;
);
myData.load("default.asp");

when i test the flash project i get 'undefined' in the text box

if anyone has any sugestion i'd love to hear them

cheers

andy

Re: noob question: loading variables from an asp file angelseyeinc
4/13/2006 3:31:53 PM
You may want to check that the ampersand in your text isn't causing a problem
because Flash uses the "&" as a delimiter between variable name and value sets.
I'm not sure how to fix it if it's the problem, but if it is...at least you'll
be pointing in the right direction.
Re: noob question: loading variables from an asp file Motion Maker
4/13/2006 5:46:53 PM
myText_txt.htmlText this.myvariable;
should be
myText_txt.htmlText = this.myvariable;


as well test for success

myData.onLoad = function(success){
trace("success = " + success)

as well test the results
myData.onLoad = function(success){
trace("success = " + success)

trace("results = " + this.toString())

as well get the capitalization of AS class names within the standards.

myData = new LoadVars();

Use the excellent templates examples in help to help write code:
http://livedocs.macromedia.com/flash/8/main/00002329.html
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
trace(this.toString());
} else {
trace("Error loading/parsing LoadVars.");
}
};
my_lv.load("default.asp");


Be sure your ASP is not returning whitespace before and after the ASP tags
and no HTML.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
hi,

im totally new to flash 8 and am currently trying to get flash to draw some
information via a variable on an asp page already created.

when i type the following at the bottom of the page where all the queries
etc...
<%
Response.Write("myvariable=" & StationName)
%>


this is what i get

myvariable=Brackley MOT & Service Centre

So from that I obviously want to have the 'Brackley MOT & Service centre'
to
be displayed on my flash movie.

I have a basic flash movie setup which works fine. a text box called
myText_txt
This is the actionscript used in frame one

myData = new loadvars();
myData.onLoad = function(){
myText_txt.html = true
myText_txt.htmlText this.myvariable;
);
myData.load("default.asp");

when i test the flash project i get 'undefined' in the text box

if anyone has any sugestion i'd love to hear them

cheers

andy

AddThis Social Bookmark Button