Michael,

(It slipped my mind, this)

OR - you could use ADDED_TO_STAGE EventListener in that frame, and have a
function wrap around your button listener code. Should do the trick.

- Daniel -

On Fri, Nov 14, 2008 at 10:16 AM, Daniel Boey <[EMAIL PROTECTED]> wrote:

> Michael,
>
> Fix 1 (more like Issue 1) is probably the issue you're facing:
>
> http://curtismorley.com/2007/08/15/flash-cs3-flex-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/
>
> I've made similar tests that scripts just don't work because the objects
> are not there yet even though you're supposed to be on that frame already.
> There might be better fixes, but you could "try" a  gotoAndPlay instead to
> "mainoffice" and add a stop() to the next frame and have your EventListener
> code there.
>
> - Daniel -
>
>
> On Thu, Nov 13, 2008 at 11:52 PM, Michael Knauf <[EMAIL PROTECTED]>wrote:
>
>> First time posting on this list, hope y'all can help with this one, it
>> should be easy, but having gone through what seems to be every possible
>> permutation, I can't get it right.
>>
>> in the main movie, there's a button named "upperoffice", and the event
>> listner correctly triggers the displayinfobox function to send the movieclip
>> infoboxmc to a named frame... the code in frame 1 of the main movie:
>>
>>        upperoffice.addEventListener(MouseEvent.CLICK, displayinfobox);
>>        function displayinfobox(event:MouseEvent):void
>>        {
>>                infoboxmc.gotoAndStop("mainoffice");
>>        }
>>
>> That works as expected. Now, there's a button in the infoboxmc movieclip
>> that I'd like to have send the movieclip to another named frame, I expect
>> that I need to have the event listener point to the button in the movieclip,
>> some thing like
>>
>>        infoboxmc.closethat.addEventListener(MouseEvent.CLICK,
>> closeinfobox);
>>        function closeinfobox(event:MouseEvent):void
>>        {
>>                infoboxmc.gotoAndStop("blank");
>>        }
>>
>> but that does not work....
>>
>> I get something like: "TypeError: Error #1009: Cannot access a property or
>> method of a null object reference.
>>        at interactivecampmap1_fla::MainTimeline/frame1() "
>>
>> this should be pretty simple, but I can't come up with a path that
>> correctly targets the button inside the movieclip, can anyone point me in
>> the correct direction?
>>
>> Michael
>>
>>
>> _______________________________________________
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> --
> Thanks & Best regards,
> Daniel Boey
>



-- 
Thanks & Best regards,
Daniel Boey
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to