Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




This.onRollOver And This._parent.onRollOut Problem When Used Together



here is my code

Code:

inity = this._parent._y;
endy = inity+125;
speedy = 0;
down=0;

this._parent.onRollOut=function() {
goUp();
}

this.onRollOver=function() {
down=1;
trace(down);
}

function goUp() {
if(down==1) {
this.onEnterFrame = function() {
speedy = (speedy+(inity-this._y)/3)*.7;
this._y += speedy;
};
}
}



for some reason the this.onRollOver function doesn't seem to work.

also, to get the full effect, i run it at 36 fps

does anybody have any ideas why?

thanks!



DevShed > Flash Help
Posted on: May 14th, 2004, 04:49 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help OnRollover/onRollout
I am having trouble with my movie clip rollover/rollout animation. What i want is simple. I would like when rolled over the "about button" for the about animation to play and when roll out, for the about rollout animation to play. Once i get help with this i will animate the other buttons.

i have attached my fla.

Please explain what im doing wrong and feel free to edit the fla for me.

OnRollOver And OnRollOut
Hey,

Im trying to create a menu similiar to the one used here
http://www.jazzcafeposk.co.uk/index-en.html

I dont really use flash and so far i have got the menu to glide in from the left. But if you look at this example. When you take the mouse OFF it instantly performs the RollOut movieclip.

On mine, when you take the mouse off. it continues playing the rolling in clip and then dissapears(or stays depending if i have "stop(); in place)

The rolling out will not play unless the rolling in clip is complete.
Here is the file i have been working with and the code.


ActionScript Code:
in_mc.onRollOver = function()
{
    this.play();
};

in_mc.onRollOut = function()
{
     this.Play(11);
};

I would like it to play from frame (11) as soon as the mouse leaves the clip area.

Many thanks for your help.

OnRollOver, OnRollOut
I have some movie clips I am using as buttons. They all have the same animation:
They consist of one layer which blurs a text through 16 frames (white text), and then blurs the same text in a different color(pink text) from frame 17-32. The layer below fades in duplicate text of opposite color(pink under white, white under pink), from frame 1-16, and frame 17-32. There is a stop at keyframe 1 and keyframe 16.

Here is the actionscript:

_root.home_btn.onRollOver = function() {
_root.home.gotoAndPlay(2);
}
_root.home_btn.onRollOut = function() {
_root.home.gotoAndPlay(17);
}


_root.models.onRollOver = function() {
_root.models.gotoAndPlay(2);
}
_root.models.onRollOut = function() {
_root.models.gotoAndPlay(17);
}


_root.apply.onRollOver = function() {
_root.apply.gotoAndPlay(2);
}
_root.apply.onRollOut = function() {
_root.apply.gotoAndPlay(17);
}


_root.special.onRollOver = function() {
_root.special.gotoAndPlay(2);
}
_root.special.onRollOut = function() {
_root.special.gotoAndPlay(17);
}


_root.contact.onRollOver = function() {
_root.contact.gotoAndPlay(2);
}
_root.contact.onRollOut = function() {
_root.contact.gotoAndPlay(17);
}


If I roll over, the text blurs from white to reveal pink underneath, if I roll out the text blurs from pink to reveal white. The problem is if I roll over or out too quick, the text stays pink, never plays the roll out animation and doesn't fade back to white.

Whats the problem?

Here is a link to test it.

http://www.south-beachmodels.com/links.swf

OnRollOver, OnRollOut
I have some movie clips I am using as buttons. They all have the same animation:
They consist of one layer which blurs a text through 16 frames (white text), and then blurs the same text in a different color(pink text) from frame 17-32. The layer below fades in duplicate text of opposite color(pink under white, white under pink), from frame 1-16, and frame 17-32. There is a stop at keyframe 1 and keyframe 16.

Here is the actionscript:

_root.home_btn.onRollOver = function() {
_root.home.gotoAndPlay(2);
}
_root.home_btn.onRollOut = function() {
_root.home.gotoAndPlay(17);
}


_root.models.onRollOver = function() {
_root.models.gotoAndPlay(2);
}
_root.models.onRollOut = function() {
_root.models.gotoAndPlay(17);
}


_root.apply.onRollOver = function() {
_root.apply.gotoAndPlay(2);
}
_root.apply.onRollOut = function() {
_root.apply.gotoAndPlay(17);
}


_root.special.onRollOver = function() {
_root.special.gotoAndPlay(2);
}
_root.special.onRollOut = function() {
_root.special.gotoAndPlay(17);
}


_root.contact.onRollOver = function() {
_root.contact.gotoAndPlay(2);
}
_root.contact.onRollOut = function() {
_root.contact.gotoAndPlay(17);
}


If I roll over, the text blurs from white to reveal pink underneath, if I roll out the text blurs from pink to reveal white. The problem is if I roll over or out too quick, the text stays pink, never plays the roll out animation and doesn't fade back to white.

Whats the problem?

Here is a link to test it.

http://www.south-beachmodels.com/links.swf

OnRollOver & OnRollOut On MC
Hi, I am new to action script and here is my problem, please take a look at my attached test file.

I have a main movie clip on the stage, and 3 sub movie clips are inside this main mc. I want to do some action on the onRollOver and onRollOut on the main mc, i got that working with no problem. In those 3 sub mc, i have the on(Release) script on each of these sub mc to do some action.

However, If I use the onRollOver and onRollOut on the main mc, the on(release) in those 3 sub mc will not execute. Is there any other way to accomplish this? Thank you for any help.

2 MC, Alpha And OnRollOver/OnRollOut
Hi : )

can someone take a look in the swf attached? Trying to mouse over one ball and than left it it ok.. but when you left ball 1 and go to ball 2 the ball 1 didnīt set alpha to 0.. it stop suddenly,...

can someone help out?


Code:
ball_mc._alpha = 0;
ball_mc.onRollOver = function() {
this.useHandCursor=false;
onEnterFrame = function() {
if (ball_mc._alpha < 100) {
ball_mc._alpha += 10;
}else{
delete this.onEnterFrame;
}
}
}
ball_mc.onRollOut = function() {
onEnterFrame = function() {
if (ball_mc._alpha > 0) {
ball_mc._alpha -= 10;
}else{
delete this.onEnterFrame;
}
}
}
ball_mc.onReleaseOutside = function() {
onEnterFrame = function() {
if (ball_mc._alpha > 0) {
ball_mc._alpha -= 20;
}else{
delete this.onEnterFrame;
}
}
}

ball_mc2._alpha = 0;
ball_mc2.onRollOver = function() {
this.useHandCursor=false;
onEnterFrame = function() {
if (ball_mc2._alpha < 100) {
ball_mc2._alpha += 10;
}else{
delete this.onEnterFrame;
}
}
}
ball_mc2.onRollOut = function() {
onEnterFrame = function() {
if (ball_mc2._alpha > 0) {
ball_mc2._alpha -= 10;
}else{
delete this.onEnterFrame;
}
}
}
ball_mc2.onReleaseOutside = function() {
onEnterFrame = function() {
if (ball_mc2._alpha > 0) {
ball_mc2._alpha -= 20;
}else{
delete this.onEnterFrame;
}
}
}
Thanks a lot ; )

OnRollOver() And OnRollOut() Issues
I'm using the following code:


Quote:




this.hitArea = this.aum;

this.abe.onRollOver() = function() {
_root.hex_image.superbowl.loadMovie(_global.ab_img );
};
this.abe.onRollOut() = function() {
_root.hex_image.superbowl.unloadMovie();
};




And when I compile its returning


Quote:




**Error** Symbol=About Us Button, layer=Layer 1, frame=1:Line 3: Left side of assignment operator must be variable or property.
this.abe.onRollOver() = function() {

**Error** Symbol=About Us Button, layer=Layer 1, frame=1:Line 6: Left side of assignment operator must be variable or property.
this.abe.onRollOut() = function() {

Total ActionScript Errors: 2 Reported Errors: 2




All of the objects exist in the various components so I'm unsure what is causing the problem. Any assistence would help.

-- Drahkar

Dynamic OnRollOver And OnRollOut
Hi,


ActionScript Code:
for (i = 1; i < 7; i++)
{
this.attachMovie("rond", "mc"+i, this.getNextHighestDepth());
           
            setProperty(["mc" + i], _x, 10);
            setProperty(["mc" + i], _y, 50 * i);
        }

Onrollover Onrollout Easing
I'm trying to get a mc to change it's y position slightly (as in a menu with just the edge showing and when you rollover the mc, it'll slide out to show the rest of it and when you rollout of the mc, it'll go back to where it was). I'm going for something a little different from all the dropdown style systems I've seen everywhere because I want the entire thing to move out and in. Using this, I can get a partial solution:

movieclip.prototype.mouse_hit = function(clip) {
if (clip.hitTest(/:_xmouse, /:_ymouse, true)) {
clip.rollout = false;
clip.rollover = true;
clip.tempout = true;
} else {
clip.rollout = false;
clip.rollover = false;
if (clip.tempout == true) {
clip.tempout = false;
clip.rollout = true;
}
}
};

and then on the mc something like this:
onClipEvent (enterFrame) {
mouse_hit(this);
if (rollover == true) {
_y =200;
}
if (rollout == true) {
_y = 356;
}
}

It pops out and in but of course I'd rather have some motion with easing. Therein lies the problem. I'm not a strong enough coder to get it all put together and I suppose there could be a better solution to this as well. Any suggestions?

[Q] Limitations Of OnRollOver OnRollOut
I think for onRollOver and onRollOut Animations where you have a movieclip that you want to animate to a certain frame, if the user gets off the mouse you want it to animate back to the original position.

But onRollOver and onRollOut if the user moves the mouse quickly enough, it will leave the moviclip in the wrong position.

I know hitTest is a solution, but its too sluggish with 7 button items.

ON ROLLOVER
FRAME 1 FRAME 5
stop(); stop()
BALL GOING LEFT

ONROLLOUT
FRAME 5 FRAME 10
stop()
ball going right to the original position


Any other work around?

OnRollOver OnRollOut Jiggle
Hello,

I have a loop that assigns functions to the buttons. When the mouse hits the very outside of the button, the states 'quiver'.
It looks very buggy as the mouse is at this point right in between the rollOut and rollOver state.

I would appreciate any help you can give me.

thank you,
Emma







Attach Code

for(i=1;i<=Main.length;i++){
btn_assign=this["M_"+i];
btn_assign.gotoAndStop(1);
btn_assign.onRollOver=rollover;
btn_assign.onRollOut=rollout;
btn_assign.onRelease=releese;
btn_assign.boxwidth=btn_assign._width+75;
btn_assign.P_Menu=Main[i].P_Menu
btn_assign.L_Menu=Main[i].L_Menu
btn_assign.S_Menu=Main[i].S_Menu
}

OnRollOver / OnRollout Effects
dont know if anyone can smack me in the face for this one --
im trying to make what has to be the simplelest thing -- i have to just be over complicating -

what im trying to do is create a mc that onRollOver it begins to play -- now it needs to goto a certain point in its timeline and stop there -- there it needs to check to see if onRollOut event has occured - if it has ( and could have happened way back in the mc timeline ) then the mc needs to procced to move forward in the timeline - if the onRollOut event has not occurred then the mc needs to remain stalled on the "stop" frame

ive tried everything i can think of - thanks in advance for any assistance -

OnRollOver & OnRollOut Problem
what
The below code does not work. Why? It won't preform the deletion of the onEnterFrame MC or something. Read why for more info.

Code:
menuItems.hitpoint.onRollOver = function(){
menuItems.holder._x = menuItems.alignShow._x;
this._parent._parent.createEmptyMovieClip("troll", 1000);
this._parent._parent.troll.onEnterFrame = function() {
this._parent.menuItems.onRollOut = function(){
menuItems.holder._x = menuItems.alignHide._x;
delete this._parent.troll.onEnterFrame;
}
}
}
why
I have a MC that I'm reusing four times (sort of like a menu). I'm changing the text within each dynamically. All that is working. However, I want to be able to rollOver the title name (the text I mentioned a sentence a go) and then the rollOut be for the entire MC not just the hitpoint. Any ideas?

OnRollOver And OnRollOut Problem
hey guys.. it something simple but i am just stuck on this... ok here is the problem.. i have a menu and want to use AC to make the roll overs and roll outs.. this is what i use..


PHP Code:



A = 5 //amount

for(i=1;i<=A;i++){
    knop = this["knop"+i]
    knop.i = i
    knop.stop()
    knop.onRollOver = function(){
        this.gotoAndStop(2)
    }    
    knop.onRollOut = function(){
        for(i=1;i<=A;i++){
            knop = this._parent["knop"+i]
            knop.gotoAndStop(7)
        }
        this.gotoAndStop(1)
    }





but somehow it does'nt work.. why???

Mc structure is

root
|menu
|menu buttons
| |AC script
|MC buttons with animation

OnRollover And OnRollOut Problems
Hello
im using Tween Class and when a target Mc gets rolledOver/Out it gets tween larger/back to org size.

but it gets jumpy and the target MC tweens back and worth on 2-3 frames (looks very very very laggy and buggy)
i have 24fps and ive tried regular/elastic/bounce/strong tween settnings.

Any ideas?

OnRollOver / OnRollout Effects
dont know if anyone can smack me in the face for this one --
im trying to make what has to be the simplelest thing -- i have to just be over complicating -

what im trying to do is create a mc that onRollOver it begins to play -- now it needs to goto a certain point in its timeline and stop there -- there it needs to check to see if onRollOut event has occured - if it has ( and could have happened way back in the mc timeline ) then the mc needs to procced to move forward in the timeline - if the onRollOut event has not occurred then the mc needs to remain stalled on the "stop" frame

ive tried everything i can think of - thanks in advance for any assistance -

Button.onRollOut And OnRollOver
Here's the code:


Code:
theBackground.onRollOver = function () {
Mouse.hide();
startSight();

};
theBackground.onRollOut = function(){
trace("theBackground.onRollOut called");
delete theSight.onEnterFrame;
stopDrag();
theSight._visible = false;
Mouse.show();
}
where theBackground is a button that covers the whole movie.

here's my problem:

I can leave the mouse sitting over it and the rollOver and rollOut functions get called repeatedly which results in an ugly "blinking" effect with my custom pointer.

Why do they called repeatedly and how do I stop the damn thing?

OnRollOver/onRollOut Issue
i have a piece of code that should move and grow a movieclip when rolling over, and then shrink it back and put it back in its place when you roll off. Everything works fine, except for the fact that the growth doesn't continue when you stay hovering over the movie clip, nor does the shrinking continue when you stay hovering off of it. I'm not sure why. I'd love some help in understanding this, or at least some direction to another thread or place with a similar problem.

Here's the code. Pardon my potentially bad form. I only just started learning this, so it might look kind of stupid.

Code:

function growNmove() {
   if (this._xscale<200){
   this._xscale += 10;
   this._yscale += 10;
   }
   else{
      this.onEnterFrame = null;
   }
   if (this._x < 40) {
      this._x += 10;
   }
   if (this._y < 44) {
      this._y += 10;
   }
   if (this._x > 40) {
      this._x -= 10;
   }
   if (this._y > 44) {
      this._y -= 10;
   }
   else {
      this.onEnterFrame = null;
   }
   if (cover._alpha < 70){
      cover._alpha += 10;
   }
   else {
      cover._alpha = null;
   }
}

function onHover() {
   this.onEnterFrame = growNmove
}

function shrinkNmove() {
   if (this._xscale>100){
   this._xscale -= 5;
   this._yscale -= 5;
   }
   else{
      this.onEnterFrame = null;
   }
   if (this._x > 18){
      this._x -= 10;
   }
   if (this._y > 17){
      this._y -= 10;
   }
   else{
      this.onEnterFrame = null
   }
   if (cover._alpha > 0){
      cover._alpha -= 5;
   }
   else{
      cover.onEnterFrame = null;
   }
}
function offHover() {
   this.onEnterFrame = shrinkNmove;
}
h1.onRollOver = onHover
h1.onRollOut = offHover

MAking OnRollOut & OnRollOver Animations...
I need some help in getting something to work:

I need to make a navigation button that plays a movie clip whenever the mouse is set over the button, BUT, that when the mouse leaves the button area the clip plays backwards to its original state (frame 1).

For example, the mouse is set over the button (let's say in a 50 frames movie clip, in a 1 frame scene) until the clip plays till frame 38, then the mouse leaves the area, so the clip plays backwards from frame 38 till frame 1 and stops.

One last thing, the button must one separate object inside the scene, the clip MUST be another object by itself (not a keyframe inside the button).

Pleeeeease help me solve this thing out, I'm cracking my head to understand actionscript already and can't get this simple ****in' animation done.

[F8] Tweening Problems With OnRollOver And OnRollOut
I'm trying to motion tween the enlargement and shrinking of a movie object onRollOver and onRollOut. It works well if you move the mouse slowly but if you move the mouse faster the tween appears to stop before finished and the onRollOut code fails to return the object to its previous state.

http://www.knowfear.net/~mattkime/us...deoscroll.html

offending code -
var TwMovieClip:Tween = new Tween(this, "_width", null, 105,126,2,false);
var TwMovieClip2:Tween = new Tween(this, "_height", null, 110,125,2,false);
var TwMovieClip3:Tween = new Tween(this, "_x", null, this._x,this._x + xOffset(),2,false);

should reset the object -
this.onRollOut = function():Void {
trace("onRollOut");
TwMovieClip = null;
TwMovieClip2 = null;
TwMovieClip3 = null;
this.filters = [];
this._width = 105;
this._height = 110;
this._x = this._x - xOffset();
blackBar1._alpha = 0;
txtArtist.setTextFormat(tfSmall);
txtTitle.setTextFormat(tfSmall);


movImageLg1._x = 0;
movImageLg1._y = -150;
playIcon._alpha = 0;
}

OnRollOver / OnRollOut Problems In A Movie
I've got a button (called 'americas') within a movie, and onRollOver the movie jumps to frame 2 and plays using this script sat in the timeline...

americas.onRollOver = function() {
gotoAndPlay(2);
};

...no probs there, works fine! What I can't make work is getting the movie to return to frame 1 onRollOut, using what seems a logical bit of script...

americas.onRollOut = function() {
gotoAndStop(1);
};

Any solutions gratefully appreciated, several people have come up with theories on this but can't make it work! Thx

On Action In MC Conflincts / OnRollOver / OnRollOut
I have a parent movie clip with several MC which has on(release) trigger in it. I would like to attribute a trigger to this parent MC. such as on(rollOut), which make the parent movie._visible = false when you rollOut. It would make an effect like a scroll bar.

But this doen't of course work. Since the parent movie on(rollOut) run over the child MCs' trigger, the child MCs don't fire. What can i do to run several MC actions superposed?

Removing OnRollOver/onRollOut/onRelease
hi,

i have this code setup in a frame and after jumping to another frame i would like to remove it because its not needed there. actually its in my way.

the mymc is on one layer with only one keyframe at the beginning and then just frames till the end of my timeline. i attach the mcs dynamically to mymc and then setup my actions on another layer frame by frame, as needed.

in this specific frame i don't want the mcx's to react to mouse events.
how do i do that?


Code:
this.mymc.mc1.onRollOver = function(){
startDrag(_root.tooltip, true);
}

this.mymc.mc1.onRelease = function(){

}

this.mymc.mc1.onRollOut = function(){
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
stopDrag();
}

thank you for your help,
dual

Snapping In OnRollover/onRollout Buttons
Hi!

I noticed that most buttons with animated onRollover/Rollout states you see on webpages snap ugly when you move off them too quickly.

I came up with this solution:

http://www.box.net/public/3n9rvvdm5b (fla)

http://www.box.net/public/8k7i12u75d (swf)

(move back and forth quickly to see that the button doesnt snap)

The problem with this solution is that it takes up unnecessary frames and actionscript

It would be WAY easier to just tell the button to
onRollout = reverse

How do i do that?


Thanks in advance


ADBUL

FLV: OnRollover Play, OnRollout Stop
just starting out with Flash/Action Script

I have a simple progessive flv player. I am displaying thumbnail size video snippet's on my web page.

I want it to load and pause on the first frame so there's something showing on the web page load. Then when someone mouse's over (on RollOver) start playing the clip, let clip loop forever. On mouse out (on RollOut) go back to frame 1 and pause.

This is the flv code I have to play the video in basic progressive mode:




Code:

// Create a NetConnection object
var netConn:NetConnection = new NetConnection();
// Create a local streaming connection
netConn.connect(null);
// Create a NetStream object and define an onStatus() function
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function(infoObject) {
status_txt.text += "Status (NetStream)" + newline;
status_txt.text += "Level: "+infoObject.level + newline;
status_txt.text += "Code: "+infoObject.code + newline;
};
// Attach the NetStream video feed to the Video object
my_video.attachVideo(netStream);
// Set the buffer time
netStream.setBufferTime(5);
// Begin playing the FLV file
netStream.play("my.flv");



Thanks for any help!

Progressive FLV: OnRollover Play, OnRollout Stop
just starting out with Flash/Action Script

I have a simple progessive flv player. I am displaying thumbnail size video snippet's on my web page. For simplicity's sake, let's say there is only one progressive FLV on the page.

I want the FLV to load and pause on the first frame so there's something showing on the web page load. Then, when someone mouse's over on RollOver, start playing the clip, let clip loop forever. On mouse out (on RollOut) go back to frame 1 and pause.

This is the flv code I have to play the video in basic progressive mode. What do I need to do to get the rollover/rollout working? Thanks!

Flash MX 2004 Pro



Code:
// Create a NetConnection object
var netConn:NetConnection = new NetConnection();
// Create a local streaming connection
netConn.connect(null);
// Create a NetStream object and define an onStatus() function
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function(infoObject) {
status_txt.text += "Status (NetStream)" + newline;
status_txt.text += "Level: "+infoObject.level + newline;
status_txt.text += "Code: "+infoObject.code + newline;
};
// Attach the NetStream video feed to the Video object
my_video.attachVideo(netStream);
// Set the buffer time
netStream.setBufferTime(5);
// Begin playing the FLV file
netStream.play("my.flv");

XML Driven Menu OnRollover, OnRelease, OnRollout
I can't seem to modify this Actionscript to make this XML driven menu do the following.

1. When rolling over a main menu item having the submenu stay on but then turn off when rolling out or onto any other item.

I'm sure this is basic thing I'm missing. ....Actionscript rookie here. Any help would be appreciated.

CODE:

stop();

// ***** FUNCTION LOAD XML ***** //
function loadXML(str){

navXML = new XML();
navXML.ignoreWhite = true;
navXML.onload = parseXML;
navXML.load(str);

}

// ***** FUNCTION PARSE XML ***** //
function parseXML(){

var root_element = navXML.firstChild;
var no_sections = root_element.childNodes.length;
var xval = 10;
var sub_xoffset = 0;

for(i=0;i<no_sections;i++){

var sub_yval = 25;

duplicateMovieClip("navigation.nav_clip","nav_clip "+i,i+200);
eval("navigation.nav_clip"+i)._x = xval;
eval("navigation.nav_clip"+i).title = root_element.childNodes[i].attributes.title;

// now let's fetch the subsections...

var no_subsections = root_element.childNodes[i].childNodes.length;
var current_section = root_element.childNodes[i];

// new stuff
// we'll need this value when we want to show/hide the subsections
eval("navigation.nav_clip"+i).no_sections = no_sections;
eval("navigation.nav_clip"+i).no_subsections = no_subsections;
eval("navigation.nav_clip"+i).released = false;
eval("navigation.nav_clip"+i).sectionbutton.onRoll Over = sectionButtonRelease;
eval("navigation.nav_clip"+i).sectionbutton.onRele ase = sectionButtonRelease;
// new stuff

if(no_subsections > 0){
for(n=0;n<no_subsections;n++){

duplicateMovieClip("navigation.nav_clip"+i+".subse ction","subsection"+n,n);

eval("navigation.nav_clip"+i+".subsection"+n)._y = sub_yval;
eval("navigation.nav_clip"+i+".subsection"+n)._x = sub_xoffset;

eval("navigation.nav_clip"+i+".subsection"+n).titl e = current_section.childNodes[n].attributes.title;
//subitem SPACING
sub_yval+=15;

// new stuff
eval("navigation.nav_clip"+i+".subsection"+n).file = current_section.childNodes[n].attributes.file;
eval("navigation.nav_clip"+i+".subsection"+n).subs ectionbutton.onRelease = subsectionButtonRelease;
eval("navigation.nav_clip"+i+".subsection"+n)._vis ible = 0;
// new stuff

}

// new stuff
eval("navigation.nav_clip"+i).bottom._visible =0;
// new stuff

eval("navigation.nav_clip"+i).bottom._y = (25*(no_subsections+1));
}

// new stuff
else if(root_element.childNodes[i].attributes.url != null){
eval("navigation.nav_clip"+i).url = root_element.childNodes[i].attributes.url;
}
// new stuff

// finally increment our x value

xval += 136;

}

}


// ***** FUNCTION SECTION BUTTON RELEASE ***** //

function sectionButtonRelease(){

if (this._parent.no_subsections==0 && this. _parent.url != null){
getURL(this._parent.url);
}

if(this._parent.released == false){
for(i=0;i<this._parent.no_subsections;i++){
this._parent.bottom._visible = 1;
eval("this._parent.subsection"+i)._visible = 1;
}
this._parent.released = true;
}

else if (this._parent.released == true){
for(i=0;i<this._parent.no_subsections;i++){
this._parent.bottom._visible = 0;
eval("this._parent.subsection"+i)._visible = 0;
}
this._parent.released = false;
}

}

// ***** FUNCTION SUBSECTION BUTTON RELEASE ***** //

function subsectionButtonRelease(){

var no_sections = this._parent._parent.no_sections;

for(i=0;i<no_sections;i++){

eval("navigation.nav_clip"+i).bottom._visible = 0;
eval("navigation.nav_clip"+i).released = false;

for(n=0;n<eval("navigation.nav_clip"+i).no_subsect ions;n++)
{
eval("navigation.nav_clip"+i+".subsection"+n)._vis ible = 0;
}
}

_root.loadText(this._parent.file);
}
// ***** FUNCTION LOADTEXT ***** //
function loadText(str){
loadVarsText = new LoadVars();
loadVarsText.load(str);
loadVarsText.onLoad = function() {

// if the text is html formatted, we need to make sure we can display it
_root.field.html = true;
_root.field.htmlText = this.text;
_root.field.scroll = 1;
};
}

loadXML("../xml/nav.xml");

Autoplay And OnRollOver - OnRollOut Problem On Video
Hello everyone,

my idea is the following: a video (1.flv) should start playing when you rollover the video. the video should pause when you rollout.

My problem: 1) the video doesn t pause with the command autoplay = false. It begins to play. 2) onRollOver and onRollOut doesn t work properly. Only rollout works playing and pausing.

vid1 > is the instance of my video
btn1 > is the instance of an invisible button

code:

Quote:




var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

vid1.attachVideo(ns);

vid1.autoPlay = false;

ns.play("intro/1.flv");

btn1.onRollOver = function() {
ns.play();
}

btn1.onRollOut = function() {
ns.pause();




Any ideas?

Is It Possible To Pause A Slideshow OnRollOver And Resume OnRollOut?
Hello,

Here is the problem that I’m trying to resolve:

I need to create a slideshow that allows me to pause movement onRollOver and resumes movement onRollOut. I’ve tried using onEnterFrame to control the speed of the movieclip but it seems to run infinitely. Also, the slideshow should run on a continuous loop. Is this possible? Thanks for your help.

Multiple OnRollOver-onRollOut On Nested MovieClips
As we now, u cant have multiple onRollOver-onRollOut on nested MovieClips becouse they comflict each other, and the use of the hitTest is very unpredictible and give some surprising results
This apply also for behavoirs as buttons inside of MovieClips.

So here is a prototype to manage this problem(Flash MX).

If u find a better code/way, or can improve this code I want to know. Also if somebody translate to AS2, please post the result.

Onrollover Stop / Onrollout Play / GetURL
Hi everyone!

I am fairly new to the world of Flash and AS.

Right now, I am trying to make a slideshow that allows the user to rollover a movieclip. The movieclips are basically static pictures.

When a movieclip is rollover-ed (bad grammar i know!), the flash clip stops and onrollout it resumes again. Clicking on a movieclip goes to a URL using the getURL function.

right now only the first picture works when you rollover, rollout or click on the picture... the rest stay static and don't do anything...
I would like all off them to do as the first picture. Any help ?

I have attached the fla clip

OnRollOver, OnRollOut Not Working On All Attached Clips...
i'm trying to make this little news section and for some reason the rollover and rollout works only on the last news itemClip to be attached. you can take a look at it HERE and see that the bottom one is the only one working.

can anyone tell me why and what i might have done wrong in the actionscript?

thanks for the help.


Code:

//-----------------------------------------------------------
Stage.scaleMode = "noScale";
newsXML = new XML();
newsXML.ignoreWhite = true;
//-----------------------------------------------------------
newsXML.onLoad = function(success){
if(success){
trace("success!!!");
var root = this;
var cNodes = root.firstChild.childNodes;
trace(cNodes);
_global.firstNewsItem = cNodes[0];
for (var i = 0; i < cNodes.length; i++){
item = itemHolder.attachMovie("itemClip", "itemClip" + i, i);
trace(item);
itemHolder.setMask(itemMask);
item._x = 0;
item._y = 23 * i;

item.myT.text = cNodes[i].attributes.name.toString();
item.itemDate.text = cNodes[i].attributes.date.toString();

item.myTitle = cNodes[i].attributes.name.toString();
item.myDetails = cNodes[i].attributes.details.toString();
item.myImg = cNodes[i].attributes.img;
}
item.onRollOver = function(){
this.itemM.gotoAndPlay("over");
}
item.onRollOut = function(){
this.itemM.gotoAndPlay("out");
}
item.onRelease = function(){
var aItem = this;
imgHolder.loadMovie(aItem.myImg);
myTitle = aItem.myTitle;
myDetails = aItem.myDetails;
}
}
}

newsXML.load("news_xml/newsList.xml");

AS 2 Flash CS3 - XML Menu (onRollover - OnRollout Issue)
I am trying to build upon and customize the dynamic menu XML sample that Adobe has provided. I am using AS 2.0 and flash cs3.

From the following code, I want to change the visual appearance of the top main menu when the mouse onRollover the top main menu and the sub menu is displayed. If the mouse rolls out of the main menu and down and over the submenu, I want it to retain the onRollover state of the main menu. If the mouse rolls out of the submenu, the main menu should go back to it's original visual state.

The original visual state is a purple background with an arrow pointing to the right (MC::purple_bg)
The onRollover state is a grey background with an arrow pointing down (MC::grey_bg)

The Actionscript file is attached (XmlMenu.as)

Please let me know if you need or would like additional info. Thank you! - Brad

OnRollover OnRollout, Cursor Staying On Button
I have an image that will double as a button to make it larger if you click it.
on the rollovers I have a plus and minus sign depending on which size the image is currently.

if you click the image and it gets larger the cursor will probably still be on the image. Therefore the minus_mc won't play until you move your cursor off then back on the image. How can I have the rollover refresh without having the cursor move off of the image?

Effect - OnEnterFrame Inside OnRollOver And OnRollOut
I want to apply a blur inout effect onRollOverout of the movies but I can't seem to be able to use the onEnterFrame event inside the onRollOver.

Here is the code:

Code:

import flash.filters.*;
var blur:BlurFilter = new BlurFilter(5, 5, 3);
mc1.filters = [blur];
mc2.filters = [blur];

mc1.onRollOver = mc2.onRollOver=function () {
   this.onEnterFrame = function() {
      blur.blurX -= 1;
      blur.blurY -= 1;
      this.filters = [blur];
      if (blur.blurX<=0) {
         delete this.onEnterFrame;
      }
   };
};
mc1.onRollOut = mc2.onRollOut=function () {
   this.onEnterFrame = function() {
      blur.blurX += 1;
      blur.blurY += 1;
      this.filters = [blur];
      if (blur.blurX>=5) {
         delete this.onEnterFrame;
      }
   };
};

_parent.onRollOver Overwriting OnRelease
Hey everyone,

I have some code similar to this:


Code:
mc1.button.onRelease = function() {
//do stuff
}
mc1.onRollOver = function() {
//do stuff
}
mc1.onRollOut= function() {
//do stuff
}
What's happening is my onRollOver and onRollOut are overwriting my onRelease - the onRelease doesn't work with the onRollover and onRollOut.

How can I fix this problem?

Any help here would be much appreciated. Thanks.

Creating Onrollover / Onrollout Button That Plays Its Full ONanimation When Touched
Hey all,

On most of my option MC's I have something like:

this.onRollOver = function(){
this.gotoAndPlay("onanim")
}
this.onRollOut = function(){
this.gotoAndPlay("offanim")
}

Obviousy if you quickly roll on and then off the MC the animation is staggergy and not a fluid animation.

I would like to set it so that everytime you touch/roll on the option MC it will always play its full on animation right, then it will go to the off animation.

I believe you can incorporate onenterframe object to achive this. Could someone please show me a good solution.

Any help would be great.

Fade An Image In/out Using OnRollOver And OnRollOut (was "Please Please Please Help")
guys,

Please help. I'm banging my head against a wall here and think i'm being silly.

I'm trying to fade in and fade out an image using onRollOver and onRollOut. Basically when i roll over a picture, i want the text to fade in. When i roll out, i want it to disappear. Only problem is, it'll fade in ok but not out.

The image i'm rolling over is called mc_smith_pic and i want mc_smith_info to fade in or out

Here is my code:

function fadeInImage(mcImage:MovieClip):Void {
mcImage._alpha += 10;
if(mcImage._alpha >= 100) {
clearInterval(nInterval);
}
updateAfterEvent();
}

function fadeOutImage(mcImage:MovieClip):Void {
mcImage._alpha -= 10;
if(mcImage._alpha < 100) {
clearInterval(nInterval);
}
updateAfterEvent();
}

mc_smith_info._alpha = 50;

mc_smith_pic.onRollOver = function():Void {
clearInterval(nInterval);
nInterval = setInterval(fadeInImage, 50, mc_smith_info);
updateAfterEvent();
};

mc_smith_pic.onRollOut = function():Void {
clearInterval(nInterval);
nInterval = setInterval(fadeOutImage, 50, mc_smith_info);
updateAfterEvent();
};

[F8] Flash Popup In _parent Or _parent._parent
Hi,

I'll explain what I'm trying to do first and then say how my fevered mind is trying to do it.

I want a page that has loadable dynamic text (whic I can do).

Within that text I want to be able to link (in anyway at all) to a flash (not javascript etc) popup. And I want to load dynamic text into that flash popup based on at least one variable that can be passed to it.

Right, this is the twisted route I've taken so far.

Set up a web page for my sister, this has pages for biography and news etc.
Within those pages I created a javascript popup, which was nice.
Then someone at work showed me Flash and the past two weeks have been spent trying to recreate the web page in Flash.

I got lots of tutorials that showed me how to load text dynamically (which my sister will be able to handle, as shes not a techie, that isn't a slur in the highly unlikely event she reads this:) ).

Then I saw some templates which had some fancy Flash popup with transparency. They really fit in with the look of the web site I'm setting up. Great, i thought, I'll do that.

But how to link a popup? Well I'd already seen someone putting a swf file in the dynamic text so I created a button in it's own swf file that when clicked attached a movie file with the popup in it (I followed askthegeezer 's post on setting up a transparent dragable popup).

It looked good but there are some problems with it...

The popup only appears in the dynamic text field not across the whole page, I guess this is because the dynamic text field is the parent of the swf that holds the button and the popup.

Also it appears to resize the popup based on the dynamic text field.

And I'm having problems getting each popup to appear in a reasonable place.

Finally I'm having to create a new swf for each link I want. Not a problem at the moment as it's only got three links.

Any help will be greatly appreciated.

Not sure how relevent the code is as I could be doing this completely wrong but I'll upload them anyway

Firing Function In _parent._parent
I have 1 main mc that holds three seperate mcs. I'm trying to fire a function on the nav of one of the mcs from a "content" mc, passing in the button name/id from this content mc. I can trace to parent but the trace of the function within _parent._parent is undefined.

Anyone have any suggestions, code chunk is below?


Code:
//code on button within a content mc trying to trigger the code in the nav mc.
this._parent._parent.productNavHolder.navRel(this._parent._parent.productNavHolder.btn3);

// trace comes back undefined
trace(this._parent._parent.productNavHolder.navRel);

OnRollOver Event Of Parent MC Preventing OnRollOver Of Child
I have a movieClip, which in turn has a nested movieClip. I need each of these to have thier own onRollOver events, the parent movieClip is OK, but the event never fires for the nested movieClip. Can anyone think of a workaround?

My code goes something like this:


Code:

attachMovie("mcOne", "mcOne", 100);
mcOne._x = 20;
mcOne._y = 20;
mcOne.onRollOver = function(){
trace("hi");
};
mcOne.attachMovie("mcTwo", "mcTwo", 100);
mcOne.mcTwo.onRollOver = function(){
trace("bye");
};
"hi" is output when mcOne is rolled over, as it should, but nothing is output when mcTwo is moused over.

Parent.onRollOver, Child.onRollOver Do Not Work Together
hello,

I have an arrow that should highlight on rollover and move a movieclip.

however, when used together only the last onRollOver is working, if I remove the last definition the first two start working.



Code:


gallery.butScrollLeft.arrowOver.onRollOver = addHighlight;
gallery.butScrollLeft.arrowOver.onRollOut = removeHighlight;
gallery.butScrollLeft.onRollOver = scrollLeft;

function scrollLeft()
{
this.onEnterFrame = function()
{
gallery.imgHolder._x -= .5;
if (gallery.imgHolder._x >= gallery.imgHolder._width)
{
delete this.onEnterFrame;
}
}
}

// highlight
function addHighlight()
{
this.onEnterFrame = function()
{
this._alpha += 10;
if (this._alpha >= 100)
{
this._alpha = 101;
delete this.onEnterFrame;
}
}
}



Is there a workaround? or rather is it possible to have two functions execute from the same onRollOver? what is the best way to fix this?


if you could help
thank you

Is There Such A Thing Like _parent._parent?
Is there code that lets you drill out more than one movie at a time? For example, _parent backs you out one level, where _root takes you all the way out no matter how far into movie clips you are. Is there something I can say that basically says _parent._parent instead of going all the way to _root and then drilling all that back in just to get to a movie? Thanks

Create OnrollOver Event Without OnrollOver AS
Hi guys!

I am working on a job that uses the "onMouseDown" method to create a button without using a regular button (or MC for that matter). So, I have to create a variable which defines an area between a specific _x and _y, and besides that, I have to create a function that monitors the values of _xmouse and _ymouse. If the mouse is clicked inside the _x and _y area specified, a function will be triggered.

Thatīs ok, Iīve managed to do that. What I am not able to do is to create a "rollOver" event in this situation. īCause I just canīt use buttons in this project, Iīve got to find a alternate way to create a onRollover event, just like Iīve used an alternate way to create a button (onMouseDown instead of onRelease).

I am attaching the fla to help you guys to help me...

By the way, the fla contains a free component which is not my work (credits go to http://www.iparigrafika.hu/pageflip

Thanks in advance

OnRollOut
I have a problem with onRollOut on a movieclip.
I have a web page that use frame. One for the Flash menu and one for the HTML. When I RollOver I want my menu to have a different color and I want it to come back at normal when I RollOut so I use this :

this.onRollOver = function(){
gotoAndStop(2);
}

this.onRollOut = function(){
gotoAndStop(1);
}

This work well until I RollOut of my menu and also RollOut of the Flash Frame. My mouse cursor is in the HTML frame and one of my menu still have a different color.

I'd like to know, is there a way to check if the mouse is Over a MovieClip every second of anything like that?

Is there anybody who can help me with that?

OnRollOut Ignored?
Hi, I've got a little problem with a menu that I created.
The Menu has 6 Buttons. Each button is an instance of the same symbol.
I put this code :


Code:
var coeff=2;
//var Frame=0;
var Alpha=0;

this.onRollOver=function()
{
Lighten();
}

this.onRollOut=function()
{
Darken();
}


function SetAlpha()
{
//Frame++;
/*trace("vvvvv");
trace(PictoHome_mc._alpha);
trace(Alpha);
trace(Frame);
trace("^^^^^");*/
Alpha+=coeff;
if(Alpha>100||Alpha<0)
{
if(Alpha>100)
{
Alpha=100;
coeff=-2;
clearInterval(Lightening);
}
else
{
Alpha=0;
coeff=2;
clearInterval(Darkening);
}
//Frame=0;


//return;
}
Titre_mc._x=(Alpha/100)*20+10
Picto_mc._alpha=Alpha;

}

function Lighten()
{
clearInterval(Darkening);
clearInterval(Lightening);
coeff=2;
trace("Depart du Lighten, alpha actuel : "+Picto_mc._alpha);
Lightening=setInterval(SetAlpha,2)
}

function Darken()
{
trace("Depart du Darken, alpha actuel : "+Picto_mc._alpha);
clearInterval(Lightening);
clearInterval(Darkening);
coeff=-2;
Darkening=setInterval(SetAlpha,2)
}

function SetPicto(Id)
{

Picto_mc.Symbols_mc._x=-(Id*24)
trace(Picto_mc.Symbols_mc._x);

}

function SetTitle(Title)
{
Titre_mc.text=Title;
}

You can see the swf here :

http://www.ahhohh.com/Flash

thanks!!

Mc.onRollOut
I've a new problem...
I have a movieclip that shows an animation onRollOver and an animation on RollOut but onRelease the animation enlarge itselfs but now when I'll roll out when the animation isn't open (so i didn't release) the animation plays the animation for the minimizing of the animation.

Here's my code (I know its a bit amateuristic but I'm not a programmer )

sEt = the name of the mc
oPEN = the label in the mc to enlarge
cLOSE = the label to minimize the mc
and oUT = the label to rollOut when the mc isn't maximised


Code:
if(sET = oPEN) {
sET.onRollOut = function() {
this.gotoAndPlay('cLOSE');
}
} else {
sET.onRollOut = function() {
this.gotoAndPlay('oUT');
}
}
I hope sombody can fix this

Jakke

Onrollout Mc
Hello and thank you ahead of time for any help.
I wish to create a site navigation system similar to the one found on www.jboogie.com

Heres what I have done:
I created a buttons, however as symbols they are movie clips as I tend to use movie clips for functionality over buttons. I then created my box drop animation(box_mc)
I plugged in this actionscript to the maintimeline

button.onRollOver = function(){
box_mc.gotoAndPlay(suchandsuch);
};
box1.useHandCursor=false;
box_mc.onRollOut = function(){
box_mc.gotoAndPlay(suchandsuch);
};

And this pretty much works except in order for the box_mc to 'rewind' I have to take the cursor out of it then back in then out again. I wish to make an if statement that says if the user takes the cursor out of box_mc then the mc will gotoAndPlay a specific frame. All the if statements I have tried have been complete failures. If someone could please give me some suggestions. Perhaps I am going about this project completely wrong.
thanks again for any help-
-werther

Mc.onRollOut
I've a new problem...
I have a movieclip that shows an animation onRollOver and an animation on RollOut but onRelease the animation enlarge itselfs but now when I'll roll out when the animation isn't open (so i didn't release) the animation plays the animation for the minimizing of the animation.

Here's my code (I know its a bit amateuristic but I'm not a programmer )

sEt = the name of the mc
oPEN = the label in the mc to enlarge
cLOSE = the label to minimize the mc
and oUT = the label to rollOut when the mc isn't maximised


Code:
if(sET = oPEN) {
sET.onRollOut = function() {
this.gotoAndPlay('cLOSE');
}
} else {
sET.onRollOut = function() {
this.gotoAndPlay('oUT');
}
}
I hope sombody can fix this

Jakke

Copyright Đ 2005-08 www.BigResource.com, All rights reserved