You are browsing Flash / ActionScript Forum.
SEARCH YOUR SOLUTION HERE  

Error 2037: Help


I hate to be repetitive but as I told before I am making a game. Quite obviously, the game will have sound. So I code snippetd this up to manage the sound.
ActionScript Code:
var playtrack:Sound = new Sound();
var musicChannel:SoundChannel = new SoundChannel();
var fade:SoundTransform = new SoundTransform();
var trackindex:int;
var playlist;
public function Main()
{
addEventListener(Event.ADDED_TO_STAGE, init);
}

private function init(e:Event):void
{
gotoAndStop("Title");
playlist = "Born to do This";
soundtrackPlayer();
addEventListener(Event.ENTER_FRAME, soundCheck);
}
private function soundtrackPlayer()
{
musicChannel.removeEventListener(Event.SOUND_COMPLETE, soundtrackPlayer);
if (playlist is Array)
{
var tempindex:int;
tempindex = Math.floor(Math.random() * playlist.length)
if (tempindex == trackindex)
{
while (tempindex == trackindex)
{
tempindex = Math.floor(Math.random() * playlist.length)
}
trackindex = tempindex;
}
playtrack = new Sound;
playtrack.load(new URLRequest(String(playlist[trackindex])+".mp3"));
}

else

{
playtrack.load(new URLRequest(playlist+".mp3"));
}
musicChannel = playtrack.play();
musicChannel.addEventListener(Event.SOUND_COMPLETE, soundtrackPlayer);
}

private function soundCheck(e:Event):void
{
if (playtrack.length - 1000 position)
{
fadeTimer.start();
fadeTimer.addEventListener(TimerEvent.TIMER, fader);
}
}

private function fader(e:TimerEvent):void
{
fade.volume -= 0.1;
}
It worked, but it still threw this error message:
Error: Error #2037: functions called in incorrect line, or previous call was unsuccessful.
at flash.media::Sound _load()
at flash.media::Sound load()
at Main soundtrackPlayer()
at Main init()
at flash.display::showObjectContainer addChildAt()
at flash.display::Stage addChildAt()
at fl.rsl::RSLPreloader contentComplete()When I ran the code snippet from a frame:
ActionScript Code:
stop();
MovieClip(root).playlist = "What I have Done";
MovieClip(root).soundtrackPlayer;
It...did not play. But it also did not throw any other error messages. Setting "What I have Done" as playlist in the main file works. So I've no solution what is going on.
Posted On: Friday, October 19, 2012 Total Views: 22
View Complete with Replies


Hi,

This webpage contains content related to Flash / ActionScript. If question related to " Error 2037: Help" is not helpful or you didn't find the question or answer you were looking for then you can ask a new question through contact form. Our development Team will be happy to help you. This article was posted on Friday, October 19, 2012 and having 22 views till Thursday, July 24, 2014.

Thank You


Related Messages:

menu_array error message  (19 Views)
I will preface this by saying that I am NOT a Flash person. I am not a web developer or designer..I am just a friend who knew a *little* about web sites and was willing to assist; After being displayn a template that some friends just HAD to have I told I'd give it a shot (no promises). I've compl
View Replies !
Flash8 gotoandplay error message  (22 Views)
Ok so I've almost finished a presentation that I've been working on for my company and I've one last error message.
At the beginning of the presentation is an intro with the logo before stopping stop(); and waiting for the user to continue. At this point (frame 80) you've the option of two button
View Replies !
as2 not throwing error message when I import bogus class  (21 Views)

hello;
I am working on an old as2 project.
I noticed that my import calls are not getting editd so I decided to Create a bogus import ... import junk; ... which should throw an error message, but it isn't.
any thoughts
View Replies !
script logical error message  (15 Views)

i added the following to a button in my flash fileActionScript Code:
on (release) {
var effect2mc = _root.lowerArea_mc;
if (effect2mc._currentframe 46) {
var effect_MC =_root.lowerArea_mc.flip_mc.ProductBox_mc.default_mc;

this.onEnterFrame = function() {
ef
View Replies !
Actionscript error messages  (34 Views)

Dear
I download flash animations from web sites and decompile them via Trillix 3.0 or Sothink SWF Decompiler. But some flash files (escepially the files includes actionscripts includes "if statements") do not work. I pasted an example code snippet snippet given below. I could not solve the
View Replies !
Statement must applicationear within on handler error message  (34 Views)

novice AS code snippetr trying to get an easy flash form to submit data to a php script, then get data back from the script.
the "send" button has this code snippet:
on(release) {
assign user-input value to lv property called years
lvOut.years = years.text;
send to a blank
View Replies !
mc buttons inside a clip error message  (17 Views)

folks
I am tuning up a flash template using CS5 AS2. This has baffled me for many days, so it is time to offer it up to those who know.
My buttons work fine in the main time line, but I wana to place them in frame 1 of a mc_pages, i get an error message about it saying "the statement mu
View Replies !
error message url link replace and refresh new link  (18 Views)
I've a hardy in the url link.
I connected the flash with php framework, click the menu button while the other has always been a double-link examples:
Menu: products -> honey vgra
-> Honey super
when I click the honey vgra normal page with the url address
http: omphandt.info
View Replies !
Key press error message  (19 Views)

I believe that the flash player has a conflict for pressing
for instance, "LEFT", "UP", "SPACE".
Theres any work around for it
Im working with that combination to run a script.
But the script its not working because of the conflict (at least I believe is a
conflict). The pc p
View Replies !
wierd error message with "?" in the URL string sendandload error message. Please assist.  (27 Views)

Dead forum member
I am trying to send some varibales to an aspx page and I am getting this error message.
myvars.send ("http: url.com login.aspxuserid="+var+"&password="+var2, "Poperating systemT");
var1 = username.text
var2 = username.text
when I press enter button, it is going
View Replies !
bizzare firefox frame error message  (33 Views)
I am loading a flash program with an automatic redirect to a frame (frame 2, in this case). Each frame has a various menu system on it, linking to a URL.
However with firefox the first two elements of this frame does not display up. Very frustrating.
IE:Firefox:The actual flash can be seen a
View Replies !
Problem with loadvariables "error message opening URL"  (40 Views)

This is my first time try to fetch info from database with flash.
So I tried to access my asp file with the following code snippet:
loadVariablesNum("data.asp" 0) or loadVariables("data.asp", this)
Both gave me the same error message "Error opening URL 'file: C: flashCode data.asp'"
View Replies !
Firefox shows flash error messages ever since i installed flash cs4  (31 Views)
Heyya
I installed flash cs4 the other day and ever since firefox will popup annoying error messages. Its probably some deerrorger, but i wana it disabled cause it comes up 5-6 times in a row when i browse the internet, (usually will happlicationen on facebook or some youtube vids in blogs).
t
View Replies !
[CS3] show final score error message - so confused   (32 Views)
My game is as good as finished but i've found a error.
There is a score system and a timer - if your score is negative and timer is positive greater than the negative of the score there is no hardy e.g. score = -10 time remaining = 50 then total = 40.
However, if score = -50, time remaining =
View Replies !
Stage event listeners causing error message  (20 Views)

Hello
I've just added a menu screen to my game and I get the following error message:
ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null Object reference.
at MyGame()
at Document onRequestStart()
at flash.events::EventDispatcher d
View Replies !
image URL loading error message  (14 Views)

Hi
I am loading images from xml images are adding to xml dynamically in PHP
PROBLEM :
if flash isn't able to load one image
it stops all the images from displaying
what should I do , if one image got stuck , the Flash keep displaying other images and BYPASS that element of Xml es
View Replies !
file upload error message  (23 Views)

I am trying to upload a file on server using File class. Its working fine on local machine. But when i a placing the php file on server it is giving Error #2038: File I O Error.Code:
var uploadFile:File = new File("file: " + this.uploadFileArray[this.count]);
uploadFile.upload(new URLReq
View Replies !
1120 error message want assist  (27 Views)

So I am really a noob and have not really used flash since 2008 but I am working with some body who insisted to use flash. Its a nightmare for me and this forum is my only hope.
So originally I was only getting one error message when I tested the file and that was that I was missing a right b
View Replies !
Can't find error message even after Deerrorging  (25 Views)

...
I've a hardy when a button makes the movie go to a labeled section... I get this error message:
Attempting to launch and connect to Player using URL D: Gaea Animation Studios Web FLA home.swf
[SWF] D: Gaea Animation Studios Web FLA home.swf - 100450 bytes after decompression
Ty
View Replies !
Any way to log AS3 error messages when executing in browser?  (22 Views)

I am having a hardy where a Flash project hangs when I run it in my browser but not when I run it locally. That made me wonder if there is some program or service that enables AS3 developers to see AS3 error messages encountered by their users - error messages that cause the Flash file to crash,
View Replies !