Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Project doesn't export as .exe and code is wrong

New Here ,
Jan 11, 2017 Jan 11, 2017

my product doesn't work it says the following error message.

A javaScript error occurred.
SyntaxError: missing ) after argument list

Not sure if its to do with this code considering it thinks everything is drag and drop even though it isn't so it shows error messages AFTER ive used the drag and drop items. this is the code for the page with the drag and drop items on it:

strawberry.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void

{

  strawberry.startDrag();

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void

{

  strawberry.stopDrag();

}

vanilla.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

function fl_ClickToDrag_2(event:MouseEvent):void

{

  vanilla.startDrag();

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

function fl_ReleaseToDrop_2(event:MouseEvent):void

{

  vanilla.stopDrag();

}

cone.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);

function fl_ClickToDrag_3(event:MouseEvent):void

{

  cone.startDrag();

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);

function fl_ReleaseToDrop_3(event:MouseEvent):void

{

  cone.stopDrag();

}

choc.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_4);

function fl_ClickToDrag_4(event:MouseEvent):void

{

  choc.startDrag();

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_4);

function fl_ReleaseToDrop_4(event:MouseEvent):void

{

  choc.stopDrag();

}

flake.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5);

function fl_ClickToDrag_5(event:MouseEvent):void

{

  flake.startDrag();

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_5);

function fl_ReleaseToDrop_5(event:MouseEvent):void

{

  flake.stopDrag();

}

logob.addEventListener(MouseEvent.CLICK, gomenu)

This is the error message:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at Mather_sproduct_fla::MainTimeline/fl_ReleaseToDrop()[Mather_sproduct_fla.MainTimeline::frame172:13]

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at Mather_sproduct_fla::MainTimeline/fl_ReleaseToDrop_2()[Mather_sproduct_fla.MainTimeline::frame172:27]

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at Mather_sproduct_fla::MainTimeline/fl_ReleaseToDrop_3()[Mather_sproduct_fla.MainTimeline::frame172:41]

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at Mather_sproduct_fla::MainTimeline/fl_ReleaseToDrop_4()[Mather_sproduct_fla.MainTimeline::frame172:55]

TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at Mather_sproduct_fla::MainTimeline/fl_ReleaseToDrop_5()[Mather_sproduct_fla.MainTimeline::frame172:69]

I can't tell if these are separate issues or the code is why i cant use the windows projector to convert to .exe

I'm really stuck and my deadline is on friday otherwise i fail i have no idea what i'm doing.

TOPICS
ActionScript
359
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2017 Jan 11, 2017

all your stopDrag() statements are misleading but won't cause an error and can be written more succinctly as:

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(e:MouseEvent):void{

stopDrag();

}

but all those 1009 errors have to be resolved before trying to exporting.  ie, it looks like none fo the those objects (vanilla, choc etc) exist when your code executes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2017 Jan 12, 2017

they do but they dont exist when i go back to a different scene - it only gives that error message when i go onto a different scene

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 12, 2017 Jan 12, 2017
LATEST

then they don't exist when that code executes after going to a different scene.  ie, you need to re-add those objects and re-add your code.

or, even better, don't use different scenes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines