0 Replies - 3988 Views - Last Post: 13 August 2013 - 06:02 PM

#1 pillarleg   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 02-August 13

Attaching a movieclip to a specific frame

Posted 13 August 2013 - 06:02 PM

Here's the problem. I'm fairly new to messing with movieclips, this I'll admit, but I think I understand what I'm doing well enough. I have a random monster generator in my game, and so when it goes to the battle screen I need a specific sprite to load there, I accomplished that with this:

toBattleBtn.onRelease = function(){
	if (travelCheck == 1){
		case "Ghoul":
		_root.attachMovie("ghoulCursor", "monOneCursor", 10);
		monOneCursor._x = 400;
		monOneCursor._y = 400;
	} else {
		worldMapDescription = "Travel where?";

I didn't post the entire frame's code, but I showed the button that does the work really. it checks the monsters name and loads the appropriate spot into the movie, AFTER switching to the battle screen.

Now I noticed that after the battle, upon leaving that frame, the monster's sprite stays on the screen superimposed over everything else. K. That's... interesting. That's okay though, because I also need that same sprite to be removed upon death, so I just did that and called it a day.

for the player's sprite I just put it on the battle screen. No need to dynamically generate it, I mean the player's gonna be in every single battle right?

Now that I've explained all that, I'm gonna get to the point.

Eventually there's gonna be other people in the party and I'm gonna need to put them into battle.

I know that if you use attachMovie() to attach a movieClip, it attaches it to the entire timeline, as I could tell by the ghoul levitating over top of the victory/gameover screen.

What I want to know is, and it's okay if it's not possible, I can just add the sprite there on that frame, and then do this:

if (companionOneName = "";)/>{
	companionOneCursor._visibile = false;

But, how can I use attachMovie() to attach a movie clip to a single frame, rather than the whole movie?

I'd like to attach the sprites of the companions in your party to the battle screen dynamically, so that once you obtain one, it attaches to that screen.

That way when you go into battle, the sprites there, and after battle, even though you leave the frame, it stays there.

it sounds like something that'd be useful to know. It just came up today so I've google searched a bit but otherwise haven't put too much research into it, and am not tearing my hair out with frustration like in my other post. I figured I'd ask here before I got too involved or resorted to going with the above code.

Any input would be very much appreciated, thank you.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1