Lol, yet more simple actionscript problems

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

its in a mc, heres what i have.

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:


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

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:

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.

i thought so, this happend before.

, how would i go about doing that code? :wink:

thanks :slight_smile:

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

 _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 :-\

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:

anyone???

grimdeath your code didnt work :frowning:

[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(-:

thanks, but what is mc1 and mc2?

*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(-:

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:


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: