Skip to main content
August 29, 2009
Answered

deepLink

  • August 29, 2009
  • 1 reply
  • 637 views

I am implementing deepLink in Actionscript 1.0.

On the main timeline I am using the following within a mc button:

this.deepLink = '/portfolio/';

this.onRelease = _parent.btnRelease;

this.onRollOver = _parent.btnRollOver;

this.onRollOut = _parent.btnRollOut;


stop();

This works perfectly. However, once I put a mc button into another Movie Clip on the main timeline, the script no longer functions.

I have tried, unsucessfully:

_root.deepLink = '/portfolio/';

this.onRelease = _parent.btnRelease;

this.onRollOver = _parent.btnRollOver;

this.onRollOut = _parent.btnRollOut;


stop();

How can I have this mc button direct the movie to $/portfolio/ on the main timeline?

Many thanks

This topic has been closed for replies.
Correct answer Ned Murphy

If that code you first showed is still in the movieclip, then the code I showed should be okay except that the deepLink value may have to be a declared variable in the main timeline.  From what you showed originally, where it worked, that var appears to be in the movieclip... but the main timeline code is looking for it on the main timeline.

Aside from that, I am not familiar with SWFAddress beyond knowing what it's intended use is, so I can't help much at its end of things.  If it worked fine the way you first had it, then some trial and error retargeting should work things out.

1 reply

Ned Murphy
Legend
August 29, 2009

Assuming that set of functions is on the main timeline, have yotry the following:

_root.deepLink = '/portfolio/';

this.onRelease = _root.btnRelease;

this.onRollOver = _root.btnRollOver;

this.onRollOut = _root.btnRollOut;

stop();

If that doesn't work, then it may be necessary to see what's inside those functions as they may need to be retargeted for one more depth of targeting due to the addition of the movieclip.

August 29, 2009

Thanks for reply, unfortunately this didn't work.

the AS on the first frame of the movie is:

#include "SWFAddress.as"


function btnRelease() {

SWFAddress.setValue(this.deepLink);

}

function btnRollOver() {

SWFAddress.setStatus(this.deepLink);

}

function btnRollOut() {

SWFAddress.resetStatus();

}


SWFAddress.onChange = function() {

var value = SWFAddress.getValue();

if (_currentframe == 2 && value == '/') {

play();

} else {

var frame = _currentframe;

gotoAndStop('$' + value);

if (frame == _currentframe) {

gotoAndStop('$/error/');

return;

}

}

SWFAddress.setTitle(formatTitle(value));

}


stop();

How would I add more depth of targeting?
Thanks again

Ned Murphy
Ned MurphyCorrect answer
Legend
August 29, 2009

If that code you first showed is still in the movieclip, then the code I showed should be okay except that the deepLink value may have to be a declared variable in the main timeline.  From what you showed originally, where it worked, that var appears to be in the movieclip... but the main timeline code is looking for it on the main timeline.

Aside from that, I am not familiar with SWFAddress beyond knowing what it's intended use is, so I can't help much at its end of things.  If it worked fine the way you first had it, then some trial and error retargeting should work things out.