0 Replies - 636 Views - Last Post: 26 July 2011 - 09:37 PM

#1 Sudaval   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-July 11

Triggering Lightbox from Dynamic Text

Posted 26 July 2011 - 09:37 PM

I'm working with a mask within a flash document in which text can be entered to create a news archive. Typically, there will be a blurb, and then a link within dynamic text that opens a new web browser tab. What I want to do instead opening a separate tab is to open a lightbox overlay within the same web page. Up to now, I've used ActionScript and buttons within other flash documents to trigger lightbox windows, but I don't think that's going to be an option with this mask.
This time, I tried plugging in the lightbox code into the "link" box for the dynamic text. But Flash really objects. It hides or erases all the dynamic text from the point where I inserted the lightbox trigger forward, and needless to say I can't get to the lighbtox trigger within the .swf file, let alone get it to load.

I've made a simple copy of the .swf file that should show what I'm trying to do, and copies of what I believe are the relevant actionscript sections. First, the link to the .swf: available here:

http://dl.dropbox.co...DynamicText.swf

Here's the ActionScript:
stop();

fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 0;
friction = 0.3;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
	drag = true;
	this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
	dragger.scrollEase();
};
dragger.onmouseup = function() {
	this.stopDrag();
	drag = false;
};
bar.onPress = function() {
	drag = true;
	if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
		this._parent.dragger._y = this._parent._ymouse;
		this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
	} else {
		this._parent.dragger._y = this._parent._ymouse;
	}
	dragger.scrollEase();
};
bar.onmouseup = function() {
	drag = false;
};
moveDragger = function (d) {
	if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
		clearInterval(myInterval);
	} else {
		dragger._y += d;
		dragger.scrollEase();
		updateAfterEvent();
	}
};
up_btn.onPress = function() {
	myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
	myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onmouseup = down_btn.onmouseup=function () {
	clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
	this.onEnterFrame = function() {
		if (Math.abs(dy) == 0 && drag == false) {
			delete this.onEnterFrame;
		}
		r = (this._y-y)/(bar._height-this._height);
		dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
		main._y += dy;
	};
};




Thanks in advance for any suggestions.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1