Be a Supporter!

Is it Possible to do this in AS?

  • 252 Views
  • 4 Replies
New Topic Respond to this Topic
Shuko
Shuko
  • Member since: Dec. 29, 2003
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Is it Possible to do this in AS? 2005-10-13 00:24:20 Reply

Would it be possible to press a button, and have a movie clip shift position? :| I was hoping to make an easter egg using a buttonpress on an invisible button. I know how to make the button and capture the event when the user presses it, but how on earth do I move a movie clip into view? (It'll be on a layer below another graphic, and I want to move it so that it looks like it's peeking out. :P)

I'm not sure how to reference it, for one thing. And for another, I'm not so good with positioning just yet. -_-; Can someone help? Pretty please? :P


"Men don't grow up; they just grow out."

JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Is it Possible to do this in AS? 2005-10-13 00:33:03 Reply

Do you mean have an MC that's invisible, then comes up once you press the button? If so there's 2 easy solutions:

1. give the MC and instance name, then equip it with this:
onClipEvent(load){this._visible=0}

then put this on button: on(release){_root.INSTANCE NAME._visible=1}
(change INSTANCE NAME to the instance name of MC)

OR

2. have the MC in the library and give it a linkage name, put this code on the button:
on(release){attachMovie("LINKAGENAME", "LINKAGENAME", 2)}
change LINKAGENAME to the linkage name

Shuko
Shuko
  • Member since: Dec. 29, 2003
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Is it Possible to do this in AS? 2005-10-13 00:41:50 Reply

At 10/13/05 12:33 AM, JeremysFilms wrote: Do you mean have an MC that's invisible, then comes up once you press the button? If so there's 2 easy solutions:

1. give the MC and instance name, then equip it with this:
onClipEvent(load){this._visible=0}

then put this on button: on(release){_root.INSTANCE NAME._visible=1}
(change INSTANCE NAME to the instance name of MC)

OR

2. have the MC in the library and give it a linkage name, put this code on the button:
on(release){attachMovie("LINKAGENAME", "LINKAGENAME", 2)}
change LINKAGENAME to the linkage name

That's close, but not exactly it. ^^; The movie is not invisible. It's hidden behind another layer for the moment. What I want to do is make it so that when the user clicks a certain area of the stage (in this case, the area where I've put my invisible button) then the movie clip will shift position, so that they can see it. The effect I'm trying to make is something falling past a window. :) The user clicks on a window, and something falls behind it. The movie clip is already on the stage; it's just hidden, and will remain hidden until I move it. Does that make sense? ~_~;


"Men don't grow up; they just grow out."

Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to Is it Possible to do this in AS? 2005-10-13 00:42:55 Reply

Uhh...how about a more simple solution?

Just make the E.E. button,make the E.E. MC,place the E.E. MC below the stage,then just make it so when the button is pressed,then the E.E. will start playing,as in Tween the E.E. onto stage when pressing button.

On(release){
_root.ee1.play();
_root.ee2.play();
}


wat
a compessor wil raise the volume while lowering the db - chronamut

Shuko
Shuko
  • Member since: Dec. 29, 2003
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Is it Possible to do this in AS? 2005-10-13 00:52:36 Reply

At 10/13/05 12:42 AM, -Thomas- wrote: Uhh...how about a more simple solution?

Just make the E.E. button,make the E.E. MC,place the E.E. MC below the stage,then just make it so when the button is pressed,then the E.E. will start playing,as in Tween the E.E. onto stage when pressing button.

On(release){
_root.ee1.play();
_root.ee2.play();
}

-_-; Maybe I'm just getting lost in all the e.e.'s, lol. First of all, the M.C. is kind of a "movement in position" thing. There is no shift of position in it, although the character changes orientation. So if I were to just suddenly play the movie clip, the viewer wouldn't see it; it wouldn't move into view. :( And I would tween the movie clip through the track I want it to go, except I don't know how to do it ONLY when the user presses the button.

Or am I misunderstanding what you told me? :(


"Men don't grow up; they just grow out."