Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now