# Lol, yet more simple actionscript problems

**URL:** <https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081>\
**Category:** Uncategorized\
**Created:** [February 19, 2004, 3:35pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081 "2004-02-19T15:35:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cartoonfox](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cartoonfox](https://forum.kirupa.com/u/cartoonfox)\
**Post date:** [February 19, 2004, 3:35pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/1 "2004-02-19T15:35:36Z")

</div>

lol, whats wrong with me 😃 i’m trying to put a url link on a mc.

its in a mc, heres what i have.

```auto
on (press) {
	getURL("http://www.newwebpick.com/_webpick/webpick.php?categories=flash", _parent);
}

```

so the mc isnt on the root stage, its in a mc. and in the mc is anoher mc which has this code on it.

…  
but it wont work. when i press the mc, nothing happens. help  
(by the way, this swf is externaly loaded into another swf. but it wont work either way.

thanks :kir:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 7:22pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/2 "2004-02-19T19:22:50Z")

</div>

```auto

on (press) {
  getURL("http://www.newwebpick.com/_webpick/webpick.php?categories=flash","_blank");
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 7:57pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/3 "2004-02-19T19:57:55Z")

</div>

hi, thanks, but still doesnt work.

might it be something to do with the fact that the mc which this mc is in, is on the root stage, and has on(rollOver) and on(rollOut) actionscript on it?

so you roll over the mc1, and this mc2 (the one with the getURL code on) apears, and then you press on the mc2 to open a new window with the url.

hope that explains the situation.

thanks :kir:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 8:04pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/4 "2004-02-19T20:04:55Z")

</div>

That explains. You already have a rollOver and rollOut applied on the mc which it’s in. Because of that, the onPress of the movieclip inside is being ignored. You could use an onEnterFrame handler and hitTest to replace the onRollOver and onRollOut on the movieclip this one is in.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 8:10pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/5 "2004-02-19T20:10:07Z")

</div>

i thought so, this happend before.

, how would i go about doing that code? 😉

thanks 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 9:14pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/6 "2004-02-19T21:14:12Z")

</div>

my suggestion is put an instance name on the button and target it ie:

```auto
 _root.mc1.mc2.buttoninstance.on (press) {
        getURL("http://www.newwebpick.com/_webpick/webpick.php?categories=flash", _parent);
}

```

could work but i really have to see your files in order to figure it out :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 19, 2004, 9:40pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/7 "2004-02-19T21:40:15Z")

</div>

hi, thanks.

well, i cant use \_root, as this swf is gonna be externaly loaded into another, but i can use \_parent, right?

i’ll try that code, but can anyone tell me the code for using the onEnterFrame handler and hitTest that Voetsjoeba was talking about?

thanks :kir:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 1:29pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/8 "2004-02-20T13:29:30Z")

</div>

anyone???

grimdeath your code didnt work ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 3:45pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/9 "2004-02-20T15:45:25Z")

</div>

[AS]mc1.mc2.\_visible = 0;  
mc1.onEnterFrame = function() {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.mc2.\_visible = 1;  
} else {  
this.mc2.\_visible = 0;  
}  
};  
mc1.mc2.onPress = function() {  
getURL(“your Url”);  
};[/AS]

?

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 4:05pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/10 "2004-02-20T16:05:40Z")

</div>

thanks, but what is mc1 and mc2?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 4:27pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/11 "2004-02-20T16:27:16Z")

</div>

> \*Originally posted by cartoonfox \*  
> \*\*  
> so you roll over the mc1, and this mc2 (the one with the getURL code on) apears, and then you press on the mc2 to open a new window with the url.  
> \*\*

those are the instancenames of your mc’s:)  
Have a look at the attachment.

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 6:39pm UTC](https://forum.kirupa.com/t/lol-yet-more-simple-actionscript-problems/102081/12 "2004-02-20T18:39:19Z")

</div>

Sorry I got here so late cartoonfox, but my parents shut down the internet just when I was about to reply. Anyway, here’s some code you can use:

```auto

checkOut = function(){
if(!this.hitTest(_root._xmouse,_root._ymouse)){
// rollOut actions here
this.onEnterFrame = checkOver;
}
}
checkOver = function(){
if(this.hitTest(_root._xmouse,_root._ymouse)){
//rollOver actions go here
this.onEnterFrame = checkOut;
}
}
mc1.onEnterFrame = checkOver;

```

Here’s an example fla for you:
