# Simple action script but dirving me nutts!

**URL:** <https://forum.kirupa.com/t/simple-action-script-but-dirving-me-nutts/256018>\
**Category:** Uncategorized\
**Created:** [March 29, 2008, 11:12am UTC](https://forum.kirupa.com/t/simple-action-script-but-dirving-me-nutts/256018 "2008-03-29T11:12:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdulmohsen](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@abdulmohsen](https://forum.kirupa.com/u/abdulmohsen)\
**Post date:** [March 29, 2008, 11:12am UTC](https://forum.kirupa.com/t/simple-action-script-but-dirving-me-nutts/256018/1 "2008-03-29T11:12:18Z")

</div>

Hi there,

I have created a movie clip (i named it **button** ) then dragged 2 instances on stage and named each one differently.

After that I attached the following action script on each (i have only changed the line where it has the getURL in order to point to a different URL):

```auto

onClipEvent(load){
 var dir=0;
 var clicked=0;
 
 this.onRollOver = function(){
  dir=1;
 }
 this.onRollOut = function(){
  dir=-1;
 }
 this.onMouseDown = function(){
  this.getURL("[http://www.saudiaramco75.com/","_blank](http://www.saudiaramco75.com/)");
 }
}
 
onClipEvent(enterFrame){
 if(dir==1){
  this.nextFrame();
  _root.text_0.nextFrame();
 }else if(dir==-1){
  this.prevFrame();
  _root.text_0.prevFrame();
 }
}
 

```

Now when i publish the main movie, the first URL gets openned by just clicking on the main stage and not the button it self!!! Why is that happenning !!?

I have attached the source code.

Really appreciate your help guys!

Abdul
