Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A little Flash Help  (Read 789 times)

Jerick

  • Bay Watcher
    • View Profile
A little Flash Help
« on: August 15, 2010, 08:13:43 am »

I'm tring my hand at learning flash but I have run in to  a little problem:
Code: [Select]
function explode()
{
expDepth=_root.getNextHighestDepth();
var mc:MovieClip=this.attachMovie("Mc_explosion", "Mc_explosion" + expDepth,expDepth);
["Mc_explosion"+expDepth]_x = _x;
["Mc_explosion"+expDepth]_y = _y;

this.swapDepths(this.getNextHighestDepth());
this.removeMovieClip();
}
This to the best of my knowledge should make an explosion movie clip appear at the site of the site of the current movie clip.
But it doesn't.
The code compiles fine.
The movie clip that should get removed does get removed.
Any help would be much appreciated.
Logged

Josephus

  • Bay Watcher
  • The Immortal Historian
    • View Profile
Re: A little Flash Help
« Reply #1 on: August 15, 2010, 08:15:08 am »

So.. the problem is that the explosion clip instance doesn't appear?

Maybe you misspelled something somewhere. Double check your library.
Logged
Solar Rangers: Suggestion Game in SPAAAAACE
RPG Interest Check Thread
i had the elves bring me two tigermen, although i forgot to let them out of the cage and they died : ( i was sad : (

Jerick

  • Bay Watcher
    • View Profile
Re: A little Flash Help
« Reply #2 on: August 15, 2010, 09:08:01 am »

Nope. Double, tripple and quadruple checked. That's not it.

Edit:I commented out some code and commented it back in. It works now, I'm not sure why
« Last Edit: August 15, 2010, 11:27:09 am by Jerick »
Logged

jplur

  • Bay Watcher
    • View Profile
    • http://www.parker-portfolio.com
Re: A little Flash Help
« Reply #3 on: August 16, 2010, 08:08:26 am »

From briefly glancing at the code, is it possible that when you call this.removeMovieClip(); it is removing the child explosion as well?

I would do some debug testing with attaching the explosion to something higher up on the chain.

Good luck!
Logged
I ended up finding out you can speed up pregnancies by changing the mother to a cat to knock them up and changing back before labor

alfie275

  • Bay Watcher
    • View Profile
Re: A little Flash Help
« Reply #4 on: August 17, 2010, 03:35:41 pm »


Code: [Select]
function explode()
{
expDepth=_root.getNextHighestDepth();
var mc:MovieClip=_root.attachMovie("Mc_explosion", "Mc_explosion" + expDepth,expDepth);
mc._x = _x;
mc._y = _y;
this.removeMovieClip();
}
Try that.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275