Skip to main content
Known Participant
August 18, 2010
Answered

Access Captivate variable in as3

  • August 18, 2010
  • 1 reply
  • 1892 views

I used the following code on a frame within an swf that was imported to a CP4 slide. This worked fine in as2. I'm wondering how to write the same code in as3.

_parent._parent._parent.rdcmndNextSlide = 1;

Thanks

    This topic has been closed for replies.
    Correct answer Whyves

    "parent" returns a DisplayObjectContainer interface and it doesn't contain the rdcmdNextSlide property. You have to cast the object.

    try something like Object(parent.parent.parent).rdcmdNextSlide.

    If this fails too I will take a look tonight and give you the exact syntax.

    Whyves

    ____________________

    www.flash-factor.com

    1 reply

    Inspiring
    August 18, 2010

    Hi,

    For one, AS3 uses "parent" and not "_parent". Also, I believe that there are now 4 clips between the slide and your swf. So try with parent.parent.parent.rdcmndNextSlide and if not working try parent.parent.parent.parent.rdcmndNextSlide.

    If all fails, let me know and I will give you the exact function to call. It's just that I'm away from Captivate and Flash at the moment.

    Whyves

    _____

    www.flash-factor.com

    HunchboxAuthor
    Known Participant
    August 18, 2010

    Hi Whyves,

    Thanks for the help.

    Upon publish in Flash I get this message:

    1119: Access of possibly undefined property rdcmndNextSlide through a reference with static type flash.display:DisplayObjectContainer.

    Not sure what that means. Any ideas?

    WhyvesCorrect answer
    Inspiring
    August 18, 2010

    "parent" returns a DisplayObjectContainer interface and it doesn't contain the rdcmdNextSlide property. You have to cast the object.

    try something like Object(parent.parent.parent).rdcmdNextSlide.

    If this fails too I will take a look tonight and give you the exact syntax.

    Whyves

    ____________________

    www.flash-factor.com