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

Help please - ArgumentError: Error #2108

New Here ,
Mar 10, 2013 Mar 10, 2013

Hi, I am new to flash cs3 and for my clas project we have to do a flash product. I have made a movie clip which has a button inside and I have coded the button to open another scene but I keep getting ArgumentError: Error #2108: Scene Contactsvid was not found whenever I test it. The actionscript I am using is the following:

stop();

btn_contacts.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandlerbtn_contacts);

function mouseDownHandlerbtn_contacts(event:MouseEvent):void {

MovieClip(root)}gotoAndStop(1, "Contactsvid");

I have entered the name of the scene exactly how its named but it still fails to work.

Please help me

TOPICS
ActionScript
3.4K
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

correct answers 1 Correct answer

LEGEND , Mar 10, 2013 Mar 10, 2013

That looks okay, but I think I now see a problem that might be the cause, though I get different results when I test with your code...

MovieClip(root)}gotoAndStop(1, "Contactsvid");

In the middle of that line is a curly brace where a period should be.  That brace belong at the end of the function

Translate
LEGEND ,
Mar 10, 2013 Mar 10, 2013

Show the frames panel where you assigned the scene its name.

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 ,
Mar 10, 2013 Mar 10, 2013

Layer 2 is a videohttp://i.imgur.com/yY42MGY.png

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

That looks okay, but I think I now see a problem that might be the cause, though I get different results when I test with your code...

MovieClip(root)}gotoAndStop(1, "Contactsvid");

In the middle of that line is a curly brace where a period should be.  That brace belong at the end of the function

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 ,
Mar 10, 2013 Mar 10, 2013

Thank you, now I have a different problem. When I click the button the test I get this message

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

    at Simulator2_fla::MainTimeline/stopDragging()

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

 

- is declared but not instantiated

- doesn't have an instance name (or the instance name is mispelled)

- does not exist in the frame where that code is trying to talk to it

- is animated into place but is not assigned instance names in every keyframe for it

- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

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 ,
Mar 10, 2013 Mar 10, 2013
sliderMaster_mc.sliderbtn_mc.stopDrag();

this is the code that is causing the error message. I dont see why it is becuase that code is something different

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

Chances are the new error is entirely different from the other one... you solved one and are moving on to the next. 

I don't understand why you think that line is not causing the error, though you might be misreading the error message.  Show the complete error message... the first line number that gets indicated is the line that is causing the error.

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 ,
Mar 10, 2013 Mar 10, 2013

ok, this is the error I get when I press the button

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

    at Simulator2_fla::MainTimeline/stopDragging()

I did the debug thing you told me before which told me it was within this

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

    at Simulator2_fla::MainTimeline/stopDragging()[Simulator2_fla.MainTimeline::frame1:16]

heres a screenshot of the debug

debug.PNG

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

Insert a couple lines before line 16 that traces the objects used in line 16 to see which is coming up null...

trace(sliderMaster_mc)

trace(sliderMaster_mc.sliderbtn_mc);

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 ,
Mar 10, 2013 Mar 10, 2013

This is what I got once I put those lines in

[object mcSlider_4]

[object MovieClip]

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

Do those traces precede the error message?

What is the relationship between Simulator2 and Simulator 2.5?

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 ,
Mar 10, 2013 Mar 10, 2013

Simulator2.swf is the same as 2.5 but when I made a few changes I saved it as 2.5 and when I test 2.5 it still says 2 if that makes sence.

I dont think those traces so precede the error message as when I test it and click the button it says

[object mcSlider_4]

[object MovieClip]

null

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

    at Simulator2_fla::MainTimeline/stopDragging()

Shall I upload my flash file?

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 ,
Mar 10, 2013 Mar 10, 2013

I've uploaded my file to here as it will probably be easier http://www44.zippyshare.com/v/86546248/file.html

It may give you a error message about low memory but keep pressing ok and it will go away.

The actionscript with the dragging bit is in the layer called 'AS' and the actionscript for the button is within the layer 'iconsinterface/contacts'

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

What needs to be done to have the error occur?  If I drag the slider I get the traces and no error.

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 ,
Mar 10, 2013 Mar 10, 2013

Once youve dragged the slider, click on the top left box that looks like a phonebook with the outline of a person on it.

http://www.theappleclan.com/wp-content/uploads/2011/10/iPhone-OS-3.x-Contacts-app-icon.jpg

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 ,
Mar 10, 2013 Mar 10, 2013

Also forgot to mention earlier, the actionscript for the button is on the last frame of the contacts layer in iconsinterface.

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013

Your stage MOUSE_UP listener remains active even though you have left the frame where the slider exists, so when you click on anything afterwards it is unable to find the slider.

Get rid of the MOUSE_UP listener as you have it and rewrite it into the two functions as shown...

sliderMaster_mc.sliderbtn_mc.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);

sliderMaster_mc.sliderbtn_mc.stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);

addEventListener(Event.ENTER_FRAME, checkSliderX);

function startDragging(event:MouseEvent):void{
   sliderMaster_mc.sliderbtn_mc.startDrag(false, sliderBind);         
   stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
}


function stopDragging(event:MouseEvent) {
   stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
   sliderMaster_mc.sliderbtn_mc.stopDrag();
}

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 ,
Mar 10, 2013 Mar 10, 2013

Thank you very much! You have been extremly helpful and quick at replying. Thank you once again

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
LEGEND ,
Mar 10, 2013 Mar 10, 2013
LATEST

You're welcome

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