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

ClickTag issues!

New Here ,
Aug 31, 2010 Aug 31, 2010

I'm getting an error thrown...

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

It's dealing with enter_mc .. What could be the problem here?

import com.greensock.*;

import flash.events.*;

enter_mc.addEventListener(MouseEvent.CLICK, goThere);

function goThere(e:MouseEvent)

{

if (root.loaderInfo.parameters.clicktag.substr(0,5)=="http:")

{

navigateToURL(new URLRequest(root.loaderInfo.parameters.clicktag), "_blank");

trace("clicked")

}

}

TOPICS
ActionScript
1.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 , Aug 31, 2010 Aug 31, 2010

To check if parameter exists.


Translate
LEGEND ,
Aug 31, 2010 Aug 31, 2010

It is case sensitive. I believe it is clickTag.

Also, you should check for its existence:

function goThere(e:MouseEvent)
{
     if (root.loaderInfo.parameters.clickTag && root.loaderInfo.parameters.clickTag.substr(0,5)=="http:")
     {
          navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTag), "_blank");
          trace("clicked")
     }

}

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 ,
Aug 31, 2010 Aug 31, 2010

 if (root.loaderInfo.parameters.clickTag && root.loaderInfo.parameters.clickTag.substr(0,5)=="http:")

In this line, what are the two different phrases use for between the &&?

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 ,
Aug 31, 2010 Aug 31, 2010

To check if parameter exists.


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 ,
Aug 31, 2010 Aug 31, 2010
LATEST

Thanks for the help!

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