SEARCH YOUR SOLUTION HERE  

Error message 2037: Assist


I hate to be repetitive but as I told before I am making a game. Quite obviously, the game will have sound. So I coded this up to manage the sound.
ActionScript Code snippet:
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::DisplayObjectContainer addChildAt()
at flash.display::Stage addChildAt()
at fl.rsl::RSLPreloader contentComplete()When I ran the code snippet from a frame:
ActionScript Code snippet:
stop();
MovieClip(root).playlist = "What I have Done";
MovieClip(root).soundtrackPlayer;
It...didn't play. But it also didn't throw any other bugs. 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: 4
View Complete with Replies




Related Messages:

menu_array error  (3 Views)
I'll preface this by saying that I'm NOT a Flash person. I'm not a web developer or designer..I'm just a friend who knew a *little* about websites and was willing to assist; After being shown a template that some friends just HAD to have I told I would provide it a shot (no promises). I have completed the site (which was a surprise to me ), with the exception of ONE menu button It is a Flash menu (with ActionScript 2.0 and menu.xml - not that I really know what either of them do...) and of the 9 buttons I could generate links with - 8 work and 1 does not. I have spent at least 5 hours attempting to resolve it. I have copied and pasted, tried it on my own, discovered the web for assist..and STILL can't resolve it. :-(
I do not know what I'm doing wrong..all the other links work, but when I click the HOME button - this is what it says it is attempting to find: mydomain.com menu_array[0].url. (If it helps, it was a template tfound registered downloaded from dreamtemplate.com. )
I can post whatever info might be helpful to u for giving me some guidance. Just say what u want
View Replies !
Flash8 gotoandplay error  (2 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 buttons, continue or skip.
Continue sends you to gotoAndPlay(81); where the presentation continues. (note the skip button stays in its position throughout the whole presentation in case you receive bored half way)
Skip sends you to gotoAndPlay(4220); where there is an outro before stopping at the last frame with the option to repeat or EXIT.
This works
But when I click repeat (back to gotoAndPlay(81) the skip button would not work a second time...
any suggestions
View Replies !
as2 not throwing error when I import bogus class   (4 Views)

hello;
I am working on an old as2 project.
I noticed that my import calls are not getting edited so I decided to generate a bogus import ... import junk; ... that should throw an error message, but it is not.
any thoughts
View Replies !
script logical error   (5 Views)

i added the following to a button in my flash fileActionScript Code snippet:
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() {
effect2mc.gotoAndStop(effect2mc._currentframe+1);
effect_MC.gotoAndStop(effect_MC._currentframe+1);
} ;

DELETE this.onEnterFrame;
}
else
{
var effect1_MC =_root.lowerArea_mc.flip_mc.ProductBox_mc.default_mc;
if (effect1_MC._currentframe<21){
this.onEnterFrame = function() {
effect1_MC.gotoAndStop(effect1_MC._currentframe+1);
};
}
}
}
now the else part works just fine
in the if part
i need to control a nested movie clip by checking the states of both
so i added the condition that if the farme of parent movie is
then it should first play the parent movie and then the child move
but when used i the debbuger it showed that that flash skips the this.onenterframe part and goes directly to the DELETE command
I'm really confused
Pls assist
View Replies !
Actionscript bugs   (9 Views)

Dear
I download flash animations from websites 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 below. I could not solve the difficulty. Is it possible to have a look
Thanks in advance
CODE:
function ()
{
x03 = 197 511 * true;
return (eval(" x03"));
} End of the function
var x01 = 620 + x04 x05();
for ( x01 = eval(" x01") - 697; eval(" x01") == 120; x01 = eval(" x01") + 150)
{
x01 = eval(" x01") + 373;
if (false)
{
continue;
} end if
} end of for
if (eval(" x01") == 860)
{
x01 = eval(" x01") - 63;

}
else
{
if (eval(" x01") == 83)
{
x01 = eval(" x01") + 777;

} end if
x01 = eval(" x01") + 768;
if (eval(" x01") == 493)
{
x01 = eval(" x01") + 150;


} end if
if (eval(" x01") == 833)
{
x01 = eval(" x01") + 143;

} end if
x01 = eval(" x01") - 741;
x01 = eval(" x01") + 65;
var x0f = true;
if (eval(" x01") == 121)
{
x01 = eval(" x01") + 806;

} end if
if (eval(" x01") == 878)
{
x01 = eval(" x01") - 383;

} end if
if (eval(" x01") == 643)
{
x01 = eval(" x01") + 284;

} end if
if (eval(" x01") == 186)
{
x01 = eval(" x01") + 281;
if ( null)
{
}
else
{
x01 = eval(" x01") - 69;
} end else if

} end if
if (eval(" x01") == 467)
{
x01 = eval(" x01") - 69;


} end if
if (eval(" x01") == 398)
{
x01 = eval(" x01") + 578;

} end if
x01 = eval(" x01") - 931;
if (eval(" x01") == 495)
{
x01 = eval(" x01") - 29;

} end if
if (eval(" x01") == 466)
{
x01 = eval(" x01") - 383;
if (1)
{
}
else
{
x01 = eval(" x01") + 777;
} end else if

} end if
if (eval(" x01") == 797)
{
x01 = eval(" x01") - 797;

} end if

} end else ifError message OUTPUT MESSAGE :
**Error message** Symbol=sprite 32 layer=Action Layer, frame=41:Line 1: function name expected
function ()
**Error message** Symbol=sprite 32, layer=Action Layer, frame=41:Line 3: Unexpected ' ' encountered
x03 = 197 511 * true;
**Error message** Symbol=sprite 32, layer=Action Layer, frame=41:Line 5: Unexpected '}' encountered
} End of the function
Total ActionScript Bugs: 3 Reported Bugs: 3
View Replies !
Statement must appear within on handler error   (1 Views)

novice AS coder attempting to receive an easy flash form to submit data to a php script, then receive 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 window...
lvOut.send(path + "test.php","_blank");
receive results returned to lvIn
form.sendAndLoad("test.php", lvIn, "POST");
}
lvIn = new LoadVars(); generate lv Object
lvIn.onLoad = function (success) {
if(success){
PHP variable value to textbox
output.text = lvIn.returnVal;
}else{
...or notify of failure
output.text = "fail";
}
}
and throws 2 bugs:
**Error message**
Symbol=form_mc, layer=btn, frame=1, Line 10: Statement must appear within on handler

lvIn = new LoadVars(); generate lv Object
**Error message** Symbol=form_mc, layer=btn, frame=1, Line 11: Statement must appear within on handler

lvIn.onLoad = function (success)
I wana the var "lvIn" to hold the data from the php script.
I'm sure this is easy, but, being a newbie w AS I'm in want of kind assistance.
View Replies !
mc buttons inside a clip error   (4 Views)

folks
I'm 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 want to place them in frame 1 of a mc_pages, i receive an error message about it saying "the statement must appear within on onClipEvent handler". And I just can not figure out how can i do that to save my life. If pc's were cheap their would be a pile of them outside on the curb...lol
I'm thinking I want to split up this action and place some on frame 1 of the main time line and keep some for for my button on frame 1 of pages, but what part how
My button loads a new swf in the mc placeholder.
btn01.onRelease = function () {
let's first unload the current movie, to refresh the cache
(placeholder.unloadMovie());
SETUP THE MAIN VIDEO PLAYER
autoPlay = "true";
autoLoop = "false";
vidWidth = 460; aspect ratio
vidHeight = 244;
vidX = 170; position
vidY = 78;
vidPath = *link* some.flv
thumbPath = *link* some.jpg";
watermark = "show"; place show or hide, if not set watermark will be shown
watermarkURL = "link"; place ur own watermark link
seekbar = "show" show or hide seekbar
showControls = "false"; this displays the control at the beginning right away
vidAspectRatio = "fit"; set "fit", "cut", "original" or "stretch" for aspect ratio
load file externally
(placeholder.loadMovie("some.swf"));
}
Anything and every thing will extremely comprehended,
View Replies !
error url link replace and refresh new link   (3 Views)
I have a difficulty 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 tresnojoyo prod... id madu_super
but if I continue pressing the honey super error message page with the url address
http: omphandt.info tresnojoyo prod... id madu_super
which should
http: omphandt.info tresnojoyo prod...duk madu_super
Pls assist in the url what action script must be changed.
View Replies !
Key press error   (6 Views)

I believe that the flash player has a conflict for pressing
for example, "LEFT", "UP", "SPACE".
Theres any work around for it
I am working with that combination to execute a script.
But the script its not working because of the conflict (at least I believe is a
conflict). The pc plays a beep and the flash player stucks a little bit.
View Replies !
wierd error with "?" in the URL string sendandload error. Please help.   (3 Views)

Dead forum member
I am attempting 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, "POST");
var1 = username.text
var2 = username.text
when I press enter button, It's going to the browser but like this.
http: url.com login.aspxuserid=test&password=test
the "" at the end is causing difficulty.
Pls assist me.
View Replies !
bizzare firefox frame error  (7 Views)
I am loading a flash software 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. So frustrating.
IE:Firefox:The actual flash can be seen at:
http: www.tecvana.com Flash
Code snippet:
page is a FlashVar
if (_root.page>1){
gotoAndPlay(_root.page)
}else{
gotoAndPlay(2)
}
stop();
any assist would be comprehended.
View Replies !
Trouble with loadvariables "error opening URL"  (3 Views)

This is my first time try to fetch info from db 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'"
All my files (fla, swf and data.asp) are located in the same folder (ie. C: flashCode).
Does anybody have any clue Do I've to enable some sort of permission on Operating system so that flash can open access file
View Replies !
Firefox displays flash bugs ever since i installed flash cs4  (6 Views)
Heyya
I installed flash cs4 the other day and ever since firefox will popup annoying bugs. Its maybe some debugger, but i wana it disabled cause it comes up 5-6 times in a row when i browse the internet, (usually will happen on facebook or some youtube vids in blogs).
the error message starts like this:
TypeError #1009
I will paste the whole thing in this thread the next time it happens, but I am pretty sure the error message itself does not matter, I guess some debugger was installed in firefox when i installed flash cs4.btw I need to make a multiplayer risk game for facebook in flash. think it will be difficult I am already well versed in php and mysql. but i do not know any flash. i wana my flash app to communicate with the server with out reloading. is that simple with actionscript will i need to discover AJAX as well
View Replies !
[CS3] Display final score error - so confused   (7 Views)
My game is as good as finished but I have found a error.
There is a score system and a timer - if ur score is negative and timer is positive greater than the negative of the score there is no difficulty e.g. score = -10 time remaining = 50 then total = 40.
However, if score = -50, time remaining = 10 the total shows 40 instead of -40
So, in short - the final score does not show the - symbol. The score carries over to the next level and shows negative as it should - so why not in the total
Here's the code snippet:PHP Code:
Total=Number(score)+Number(timer);
SOLUTION:
Do not EMBED THE TOTAL
View Replies !
Stage event listeners causing error   (5 Views)

Hello
I have just added a menu screen to my game and I receive the following error message:
ActionScript Code snippet:
TypeError: Error #1009: Can't access a property or method of a null Object reference.
at MyGame()
at Document onRequestStart()
at flash.events::EventDispatcher dispatchEventfunction()
at flash.events::EventDispatcher dispatchEvent()
at MenuScreen onClickStart()
I decided to execute the debugger and found the reason for this error it is my two stage event listeners that are needed for my keyboard control:
ActionScript Code snippet:
stage.addEventListener( KeyboardEvent.KEY_DOWN, onKeyPress );
stage.addEventListener( KeyboardEvent.KEY_UP, onKeyRelease );
If I remove the "stage" word it works just fine but my keyboard control does not work. This code snippet is located in my class that controls the game.
Any assistance is comprehended
View Replies !
image URL loading error   (6 Views)

Hi
I am loading images from xml images are adding to xml dynamically in PHP
Difficulty :
if flash is not 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 everytime
View Replies !
file upload error   (6 Views)

I am attempting to upload a file on server using File class. Its working fine on local system. But when i a placing the php file on server It's giving Error message #2038: File I O Error message.Code snippet:
var uploadFile:File = new File("file: " + this.uploadFileArray[this.count]);
uploadFile.upload(new URLRequest(this.imageUpload_serverPath));
uploadFile.addEventListener(Event.COMPLETE, onFileUploaded);
uploadFile.addEventListener(IOErrorEvent.IO_Error message, onErrorrr);
uploadFile.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onFileUploadComplete);
PHP Code snippet
Code snippet:
I have placed cross domain.xml on server also.
Pls assist.
View Replies !
1120 error wana help   (4 Views)

So I am really a noob and have not really used flash since 2008 but I am working with somebody who insisted to use flash. Its a nightmare for me and this forum is my only hope.
So basically I was only getting one error message when I tested the file and that was that I was missing a right brace, once I inserted the brace and tested the file again I got a whopping 39 bugs. Every error is 1120 Access of unidefined property
-----------------------------------------------
Here is the Actionscript:
colombian.buttonMode = true;
microwave.buttonMode = true;
empire.buttonMode = true;
junta.buttonMode = true;
youth.buttonMode = true;
illumination.buttonMode = true;
m19.buttonMode = true;
animal.buttonMode = true;
commanche.buttonMode = true;
familia.buttonMode = true;
If XML File Load successfully, it will be voided this actions:
XMLLoader.addEventListener(Event.COMPLETE, success);
function success(e:Event):void {
xml=new XML(e.target.data);
songlist=xml.song; For adding a new song in XML File.
MusicLoading=new URLRequest(songlist[0].file);
music.load(MusicLoading);
sc=music.play();
MusicName.text=songlist[0].name;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
The Name of the XML File.
XMLLoader.load(new URLRequest("playlist.xml"));
Add Event Listeners for control buttons
PauseBtn.addEventListener(MouseEvent.CLICK,pauseSo ng);
PlayBtn.addEventListener(MouseEvent.CLICK,playSong );
NextBtn.addEventListener(MouseEvent.CLICK, nextSong);
PrevBtn.addEventListener(MouseEvent.CLICK, prevSong);
itunes.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest(""),
"_blank"); }
Prev Song functions
function prevSong(e:Event):void {
if (currentIndex>0) {
currentIndex--;
} else {
currentIndex=songlist.length()-1; Prev Song(-1)
}
var prevSongFunc:URLRequest=new URLRequest(songlist[currentIndex].file);
var prevTitle:Sound=new Sound(prevSongFunc);
sc.stop();
MusicName.text=songlist[currentIndex].name;
sc=prevTitle.play(); Writing Prev Song's name
currentSound=prevTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
Pause The Song (sc.stop)
function pauseSong(e:Event):void {
CurrentPos=sc.position;
sc.stop();
}
Play The Song
function playSong(e:Event):void {
sc=currentSound.play(CurrentPos);
}
}
-----------------------------------------------
For the love of god, what am I doing wrong
View Replies !
Can't find error even after Debugging   (5 Views)

...
I have a difficulty when a button makes the movie go to a labeled section... I get this error message:
Trying 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
TypeError: Error #1009: Can't access a property or method of a null Object reference.
at home_fla::MainTimeline frame30()[home_fla.MainTimeline::frame30:59]
at flash.show::Sprite constructChildren()
at flash.show::Sprite()
at flash.show::MovieClip()
at home_fla::MovieClip_MainMenu_4()
at flash.show::MovieClip gotoAndStop()
at home_fla::MainTimeline studioClick()[home_fla.MainTimeline::frame1:166]
Debug session terminated.
And still can not find what is wrong... this is the code snippet for the frame 30... could some body assist me out and view what is going on and what im missing plss
************************************************** ************************************************** ********************
Home Button

mc_mainmenu.btn_home.addEventListener(MouseEvent.C LICK Studio_to_HomeClick);
function Studio_to_HomeClick(event:MouseEvent):void
{
gotoAndStop("Home");
}
************************************************** ************************************************** ********************
Studio Button

mc_mainmenu.btn_studio.addEventListener(MouseEvent .CLICK, Studio_to_StudioClick);
function Studio_to_StudioClick(event:MouseEvent):void
{
trace("U still are in the Studio Section");
}
************************************************** ************************************************** ********************
Contact Button

mc_mainmenu.btn_contact.addEventListener(MouseEven t.CLICK, Studio_to_ContactClick);
function Studio_to_ContactClick(event:MouseEvent):void
{
trace("Contact Click");
}
************************************************** ************************************************** ********************
Download Button

mc_mainmenu.btn_download.addEventListener(MouseEve nt.CLICK, Studio_to_DownloadClick);
function Studio_to_DownloadClick(event:MouseEvent):void
{
trace("Download Click");
}
View Replies !
Any way to log AS3 bugs when executing in browser?   (2 Views)

I'm having a difficulty where a Flash project hangs when I execute it in my browser but not when I execute it locally. That made me wonder if there is some program or service that enables AS3 developers to view AS3 bugs encountered by their users - bugs that cause the Flash file to crash, for instance. I'm talking about what u'd normally view in the console in Flash Professional; can this be written to a file or presented to the developer in some way
View Replies !