Jump to content

on release return text field to starting _y point


Elemental

Recommended Posts

I'll skip the intro and get right to the point.

 

I have the following code on Buttons

top Button / text to scroll up

on (press, keyPress "<Down>") {	compText.onEnterFrame = function() {		if (this._y<30.1) {			this._y += 25;		}	};}on (release, releaseOutside, rollOut) {	compText.onEnterFrame = "0";}

bottom Button / text to scroll down

on (press, keyPress "<Up>") {	compText.onEnterFrame = function() {		if (this._y>-365) {			this._y -= 25;		}	};}on (release, releaseOutside, rollOut) {	compText.onEnterFrame = "0";}

these work fine scrolling the text field within the compText mc, no problem.

 

the problem is resetting the compText mc to it's original _y point with a single button click

 

within the mc I have another button (the single button click) that would take visitors to my contact page, and reset the _y position to its oroginal state 30.1

 

I've tried using a modified version of the bottom Button's code:

on (release) {	if (_root.compInfo.compText._y != 30.1) {			_root.compInfo.compText._y = 30.1;}	_root.gotoAndPlay("contact");}

but this is not working; the gotoAndPlay works fine but the compText mc does not reset to _y = 30.1 or anything else for that matter

 

obviously I'm doing something wrong, Any help would be appreciated

 

Peace,

 

NOTE: I'm still in the stone ages, using Flash MX 6.0 - hope it doesn't create a problem.

 

Link to comment
Share on other sites

Got it,

 

My error was the way I was targetting the compText movie clip.

 

Instead of:

_root.compInfo.compText._y = 30.1;

 

I should have been using:

_parent.compText._y = 30.1;

 

where _parent is the main timeline of the movie clip compInfo, the mc where compText resides (is nestted)

 

 

If you're reading this and find that I'm wrong, please correct me.

 

 

Peace,

Elemental

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...