A Few Actionscript Questions

Discussion in 'Programming' started by Louis11, Jan 6, 2009.

  1. #1
    First let me say that while I have a pretty extensive background in programming, yesterday was the first day that I opened up Flash to try any actionscripting.

    I've been attempting to program an online radio player (yes, I know that there are products already available but I am more interested in learning a bit of actionscript, and figuring out how things work).

    I've run into several problems along the way:

    1) I had my stream working yesterday, however today when I try and load it I get an error similar to: "Error Cannot open URL". I made sure that in my publish settings I have it set to allow network files, and have the following line in my code:

    System.security.allowDomain('http://' + domain);
    Code (markup):
    Apparently, it's supposed to allow the domain (or so I was told).

    2) Is it possible to check the state of a button (i.e. has it been clicked?) from inside of a class?

    3) Also, apparently if you stream continuously you will run into a memory leak with flash. I read that if you swap out two Sound objects (fade them into one another) that you can prevent said memory leak. I know in C that if you delete an object, you essentially free the memory. I have my code create an object, delete it, and recreate it? I tested it out and there doesn't seem to be a memory leak, however I would like another opinion.

    Anyway, here is a direct link to my code. Feel free to critique it
    http://pastie.org/354118

    Thanks
     
    Louis11, Jan 6, 2009 IP