Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 407999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:38:59+00:00 2026-05-12T17:38:59+00:00

Can someone please tell me where these extra characters are coming from? This is

  • 0

Can someone please tell me where these extra characters are coming from?

This is the output:

“MECHEL OAO ADS”
21.19
21.70
21.88
“+0.84%”
4736975

1

“MECHEL OAO ADS”
21.19
21.70
21.88
“+0.84%”
4736975

1

“MECHEL OAO ADS”
21.19
21.70
21.88
“+0.84%”
4736975

1

Notice the space and then the 1? Those should not be there…

Here’s the script, should just plug and play…

var quoteTimer:Timer = new Timer(1000);
quoteTimer.addEventListener(TimerEvent.TIMER, getQuote);
quoteTimer.start();

var url:String = "http://www.hupcapstudios.com/projects/getDow.php";
var stockInfo:String = "s=MTL&f=nol1hp2v";

function getQuote(e:Event):void
{
    var variables:URLVariables = new URLVariables();
    variables.info = stockInfo;
    var urlRequest:URLRequest = new URLRequest(url);
    var stockLoader:URLLoader = new URLLoader();
    urlRequest.method = URLRequestMethod.POST;
    urlRequest.data = variables;
    stockLoader.load(urlRequest);
    stockLoader.addEventListener(Event.COMPLETE, addStock);
}

function addStock(e:Event):void
{
    var stockArray:Array = e.target.data.split(",");
    var assocArray:Array = new Array("Stock: " , "Open: ", "Current: ", "High :", "Percent Change: ", "Volume: ");

    for(var i:int=0;i<assocArray.length;i++)
    {
        trace(stockArray[i]);
    }
}

and the php…

<?php

$stock = require("http://download.finance.yahoo.com/d/quotes.csv?". $_POST['info']);

echo $stock;

?>

When I just run the php (or throw the url in the browser with the post”info” concatenated I don’t get that extra space and 1 at the end…

***************** THE SOLUTION *****************

I was getting a “\n” in there, not sure why the 1 was being appended, but here is the code I’m using to make this all usable data (I’m seeking out more than one stock at a time otherwise eliminating the last bit space would have been no problem);

this is the URL to get the traced results of e.target.data:

http://download.finance.yahoo.com/d/quotes.csv?s=MSFT+GE+^N225+F+ET&f=noghl1p2vs

"Microsoft Corpora",N/A,N/A,N/A,26.71,"0.00%",0,"MSFT"

"GEN ELECTRIC CO",N/A,N/A,N/A,16.79,"0.00%",0,"GE"

"NIKKEI 225",10276.4,10216.14,10290.31,10257.56,"+0.18%",0,"^N225"

"FORD MOTOR CO",N/A,N/A,N/A,7.66,"0.00%",0,"F"

"ET",N/A,N/A,N/A,0.00,"N/A",N/A,"ET"

1

In order to make that usable I had to break it down into an array with a couple of loops…

the new addStock() function (with the results sent to a movie clips containing text fields for the data)…

function addStock(e:Event):void
{
    var array:Array = e.target.data.split("\n"); // splits the string into arrays delimited by the "\n"
    array.pop(); // eliminates the last array entry which is just white space
    var goodArray:Array = new Array(); // the array I will store the correctly formatted values

    for(var i:int=0;i<array.length;i++)
    {
        var s:String = array[i].substr(0,array[i].indexOf("\n")-1);
        var nArray:Array = s.split(",");

        for(var con:int = 0; con<nArray.length;con++)
        {
            goodArray.push(nArray[con]);
        }
    }

    var round:int = 0; // the number I need to offset the stocks information.



    for(var t:int = 0; t<stockCardsArray.length;t++)
    {
        var c:* = stockCardsArray[t]; // the array containing my movie clips with the text fields.

        c.stock_name.text = goodArray[0+round].substr(1,goodArray[0+round].length-2);

        c.open.text = "OPEN: " + goodArray[1+round];
        c.low.text = "LOW: " + goodArray[2+round];
        c.high.text = "HIGH: " +goodArray[3+round];
        c.current.text = "CURRENT: " + goodArray[4+round];
        c.percent.text = "PERCENT CHANGE: " + goodArray[5+round];
        c.volume.text = "VOLUME: " + goodArray[6+round];
        c.symbolTab.symbol.text = goodArray[7+round].substr(1,goodArray[0+round].length);

        round +=8;

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:38:59+00:00Added an answer on May 12, 2026 at 5:38 pm

    I’ve no idea why the characters are there, but I can offer a suggestion how to find out. 🙂

    Run the Actionscript code in a debugger, with a breakpoint inside the addStock() handler. At runtime, inspect the contents of the last elements of stockArray[]. I’m willing to bet it’s: “4736975\n1\n”

    Why would it be that? Probably the PHP script adds the newlines and the 1. If you view the source of the resulting page, instead of viewing it in the browser, you’ll see all the linebreaks as they really are. Remember that the browser collapses all whitespace unless specifically told not to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please tell me what this means: 07-04 09:54:38.048: I/DetailActivity(15496): Title that is
Can someone please tell me what's wrong with this sp. The logic seems to
Can someone please tell me why this doesn't work? I'm trying to show and
Can someone please tell me how to show all privileges/rules from a specific user
Can someone please tell me whats wrong with this code. I'm not getting complete
Please, can someone tell me what does this.init.apply(this, arguments) do in the code below?
So can someone please tell why neither of these options will actually submit the
Can someone please tell me why this header wont go straight across? My goal
Can someone please tell me what do these lines of code do *(a++) =
Can someone please tell me the difference exactly between these 2 RegEx's? '/[^a-zA-Z0-9\s]/' and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.