Welcome visitor
* Login
* Register
It is currently May 23rd, 2019, 8:46 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Flash / ActionScript » ActionScript 3.0



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  object moving stops at certain position
PostPosted: February 10th, 2009, 10:03 pm 
User avatar

Posts: 79
Hi,
can you tell me how to write the code to stop the objects when they hit a certain point? Basically this is what i have
addEventListener(MouseEvent.ROLL_OVER , ovrBtn);

function ovrBtn(e:MouseEvent) {
addEventListener(Event.ENTER_FRAME, objectUp);   
}

function objectUp(e:Event) {
   var position = MC1.y;
   MC1.y = position - 10;
}


Last edited by virus_342 on February 10th, 2009, 10:08 pm, edited 1 time in total.

Top
 Profile  
 
  Re: object moving stops at certain position
PostPosted: February 10th, 2009, 10:06 pm 

Posts: 117
This is how I would do it
function objectUp(e:Event) {
   if (MC1.y > 'desired point') {
      var position = MC1.y;
      MC1.y = position - 10;
   }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Flash / ActionScript » ActionScript 3.0


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

Search for:
Jump to:  
cron