Code on buttons works while on movieclips it doesn't

  • mtolgao
  • Newbie
  • Newbie
  • mtolgao
  • Posts: 7

Post 3+ Months Ago

Hello,

I've got several buttons in a tween (graphic) and a few movieclips in two of the buttons. They all have the same code

Code: [ Select ]
on (release) { var urun:LoadVars = new LoadVars();
urun.load("var.php?durum=satilacak&kategori=yuzuk");
_root.gotoAndStop("galeri"); }
  1. on (release) { var urun:LoadVars = new LoadVars();
  2. urun.load("var.php?durum=satilacak&kategori=yuzuk");
  3. _root.gotoAndStop("galeri"); }


(yuzuk part may vary)

but this code works only on buttons, not on movieclips. What else can I do?

Best regards,
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Its been a while but I'm pretty sure the problem is that in AS1 (which your using) movieclips couldn't be used as buttons. This has since changed but you have to go about it a little differently.

give your movieclips an instance name and then create a frame on your timeline to contain actionscript. (Make sure you DO NOT have the movie clip selected or the code will try to attach to the mc and not the timeline).

Then you would need a variation of:
Code: [ Select ]
mcInstanceName.onRelease = function(){
// button code
}
  1. mcInstanceName.onRelease = function(){
  2. // button code
  3. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.