Solved

Loadvars command working on local machine but not downloading data on server

Posted on 2007-11-21
3
347 Views
Last Modified: 2010-10-05
I have a flash movie that downloads a csv file from yahoo finance (stock quote feed) and parses the information then displays it in some dynamic text boxes.

The movie works fine when I view it on my local machine standalone player, however, when the swf is embedded in my aspx page it refuses to load the csv file data i.e. I just get nothing

somebody please give me direction!
var temp = new LoadVars();
var theFileObj = new LoadVars();
var theFile = temp.sendAndLoad("http://download.finance.yahoo.com/d/quotes.csv?s=AXC.TO&f=sl1d1t1c1ohgv&e=.csv", theFileObj, GET);
theFileObj.onData = function(src) {
	var myDataProvider = new Array();
	var theFileArray = src.split("\r\n");
	var theFieldNames = theFileArray[0].split(",");
	var numberOfFields = theFieldNames.length;
	for (var j = 0; j<numberOfFields; j++) {
		// Remove quotes from field names 
		theFieldNames[j] = removeQuotes(theFieldNames[j]);
		trace(theFieldNames[j]);
		//trace(j);
		switch(j) {
			case 1:
			_root.price.text = "$" + theFieldNames[j] + " CAN";			
			var curr = theFieldNames[j];
			case 4 :
			_root.stockChange.text = "Change     : " + theFieldNames[j];
			case 5 :
			_root.stockChange2.text = "Last Price : $" + theFieldNames[j] + " CAN";
			var init = theFieldNames[j];
			case 8 :
			_root.vol.text = "Volume     : " + theFieldNames[j];
		}
			
			
	}
	_root.updated.text = "Updated " + theFieldNames[2] + " " + theFieldNames[3];
	if (curr < init) {
		_root.stock.gotoAndPlay("down");
	}else{
		_root.stock.gotoAndPlay("up");
	}
		
};

Open in new window

0
Comment
Question by:2nde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 37

Accepted Solution

by:
CyanBlue earned 125 total points
ID: 20339654
That's where the cross domain security steps in...  You basically need to create an ASPX page that fetchs the data from the Yahoo site and feed it to your Flash file...  So, Flash calls ASPX file in YOUR domain, which fetches data from Yahoo domain, and feeds the data back to Flash so that Flash can do whatever you need to do...

Check on this page for more information...
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16520&sliceId=1

CyanBlue
0
 

Author Comment

by:2nde
ID: 21014002
Thanks for your feedback CyanBlue, was tied up with some other programming issue hence the time lapse.

Tried your suggestion, but now I'm having a new problem i.e. my aspx page gets a server timed out response when trying to download the csv info from the yahoo website ...

nutz
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question