ActionScript 2.0 :: Get A Button To Work When Its Nested In A MC That Has An OnEnterFrame With A OnPress Command Targeted To It?

Apr 13, 2004

How can I get a button to work when its nested in a MC that has an onEnterFrame with a onPress command targeted to it?

Here's the code for my "popup" MC located on the main timeline.

popup.onEnterFrame = function(){
this.onPress = function() {
this.startDrag(false);

[code]....

Within that same MC is a button that tells it to close. However, I run a trace command to it and nothing happens. It seems like the onPress nested in the onEnterFrame is over-riding my button on(press).

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Targeted MovieClips Do Not Work Once Loaded Into Container

Oct 3, 2002

I have several external SWF (child) movies that are to be loaded upon demand into another SWF container (parent) movie file. Pretty straight forward. Each of the child movies has MCs communicating with other MCs within the same child movie. For instance the timeline of one MC will have a frame action, which targets another MC instance to play(). Again, Pretty straightforward stuff.

These files work beautifully when viewed independently. The problem is when they are loaded into the parent container movie the target MC functionality no longer works. I believe it's because once the child movie is loaded into the parent movie the absolute path of the targeted MC has changed and what was once the '_root' in the child movie is no longer the actual root?

I have tried both methods in the child movie:

//method without using 'with'
_root.ContentWindow.play();
And using the 'with action like so:
//method using 'with
with (_root.ContentWindow) {
play();
}

It would seem that in theory once the Child SWF file is loaded into the Parent SWF file the targeted path would have to have another level in it - cuz now the MC 'ContentWindow' is no longer one level down from the '_root' but two levels?
For example: _root.LoadedChildMovie.ContentWindow.play()

View 3 Replies

ActionScript 2.0 :: Make LoadMovie Work From Both Button And Next / Previous Command?

Feb 13, 2006

I have a photographer's portfolio site in the works. I'm using loadMovie connected to thumbail buttons of each photo to show a larger version of the photo. Here is the script[code]...

Now the photographer would also like to have a next/previous arrow buttons so the user can click through like a slide show. Is there a way to have Flash know what movie is currently loaded and based on that information go to the next or previous?

View 1 Replies

ActionScript 2.0 :: Button OnPress Calls Another Button's OnPress?

Nov 5, 2007

[URL]

First, click on the Abaco island shape on the map. You'll see on rollOver there is a glow around the island. Now click on that island and the glow remains for the zoomed-in detailed view. When you return to map and zoom back out, the glow is removed.

Now, compare this with clicking on the island name "Abaco" from the list on the right, instead of clicking directly on the island from the map. It zooms in and shows the details fine, but the glow that should be there is not.

The reason this problem is very perplexing for me, is that the onPress action of the list button in the right column calls the onPress function of the map button. So, theoretically they should do the EXACT same thing when pushed. But clearly they don't.

Here is the code for the button from the list on the right panel:

Code:
listAbaco_mc.onRollOver = function() {
_root.map_mc.abaco_mc.button_btn.onRollOver();
};

[Code]....

There is more code, for example rollOver, rollOut, and Press actions for the other island buttons, but they are all of the exact same format as the Abaco island button and they all have the same problem.

So, to recap, the problem is that the list button in the right panel do not function properly onPress, even though they are calling the onPress function of the island buttons directly, and the island button onPress function works perfectly. Strangely, all but one little thing works. So it's obviously getting to the correct functions and going through the code as planned, yet that one part about the glow is being ignored or otherwise messed up.

View 12 Replies

ActionScript 2.0 :: OnPress Doesn't Work If The Mouse Button Is Pressed Again But The Mouse Is Not Moved?

Jul 26, 2006

I have a very simple piece of code but it has one very annoying bug. When I press the button a second time, the code doesn't work. The only way to get the code to work is by moving the mouse a tiny bit, or moving the mouse off the button and back on. make a button that can be clicked many times without moving the mouse?

Code:
randommultiquiz.onPress = randommultiquizOnPress;
function randommultiquizOnPress() {
_root.attachMovie("connect", "newconnect", 200);
newconnect._x = 0;

[code]....

View 9 Replies

ActionScript 2.0 :: Nested Button Work If Placed On Frame 1

May 19, 2007

I have a MC on my stage that has 2 buttons nested inside. So, the problem is that I have a stop(); actions on the first frame ( first frame is blank ) and I only play the movie once someone rolled over another button outside this MC. Because I'm giving the instructions to my buttons from the timeline. I have all the code on a frame and am calling the buttons from there but it seems that the buttons won't work properly if they are not placed on the first frame.

Example:
_root.myMC.otherMC.myButton.onRelease = function(){
getURL("[URL]","_self");
}

That simple thing won't work if the button are placed the way they are now, it seems that flash can see the button only if they are at frame 1... and no, I don't want to put the code directly on the button, I want to make it work this way.

View 2 Replies

Getting A Button To Load Into A Targeted Frame?

Mar 9, 2009

i have a web page with 2 frames : leftFrame and mainFrame. The left frame is my menu with flash buttons - home, about, news and contact.

What i want is this : when the user hits the "contact" button, i want contact.html to load in mainFrame.i've been at it for 2 days,, searching help, tutorials, sites, everything

i've got the beggining of the script :

this.onMouseDown = function() {
getURL(contact.html target="mainFrame");
}

View 21 Replies

ActionScript 3.0 :: Only Targeted Area To Be Working On Button?

Sep 13, 2009

I attach this flash filecontaining my folderIts basically a button.and when I move my mouse over to the helmet the speech bubble with descriptions comes up.basically I just want my helmet to be the working area.at the moment, when I move my mouse over to the where speech bubble is going to be, button works... but I only want my helmet to be the working area..so mouse over to the helmet and speech bubble comes up. not anywhere else.

View 6 Replies

ActionScript 2.0 :: Nested Buttons - Get This Effect With The Rollovers, And Get My Url Button To Work /

Jan 15, 2009

On the stage I have 3 objects on the stage which are on top of each other:

top: transparent button (which controls the mc underneath)

under this button: an image which is a mc

under this image: a graphic background with text that describes the image, and a new trans button which will send the users to a separate url.

Problem:The button to go to the url does not work.

To make things simply, I have the top button setting the alpha of the mc to 0% onRollover, in order to view the text. And reset it to 100% on RollOut.

how I can still get this effect with the rollovers, and get my url button to work too?

View 1 Replies

ActionScript 2.0 :: OnEnterFrame=null - OnEnterFrame=undefined & Delete OnEnterFrame

Mar 29, 2008

onEnterFrame=null, onEnterFrame=undefined & delete onEnterFrame....

Which one to use??? What are the performance considerations. If all my movieclips on-stage are running a MovieClip.prototype.onEnterFrame = function() {run initial stuff before setting onEnterFrame=null/undefined... }, will there be performance hits? It's sad that delete onEnterFrame doesn't work unless I delete the prototype enterFrame as well, which would make the clips reinitailise itself again once you declare the enterFrame prototype again (i need to do this since there's more movieclips that end up appearing on-stage, and they need to automatically initialises themselves the moment they appear).

[Code]...

View 5 Replies

ActionScript 1/2 :: Buttons Don't Work After Adding OnPress?

Nov 12, 2009

I have an MC that has a graphic. I have faked buttons for just the over state, so it shows a border around a portion of the graphic. That works fine until I added this to the MC:
 
this.onPress = function(){    if (this._currentframe != 1) {
rewind = true;
}}
 
The onPress function does what it should do, but the buttons no longer show their over state when I hover over them.

View 7 Replies

ActionScript 2.0 :: OnPress Inside OnLoadInit Do Not Work

Mar 31, 2011

I try to use onPress function inside an onLoadInit function but nothing will be traced. I can see my hand cursor over my icons though. I also tried with onLoadComplete, but no change...

[Code]...

View 0 Replies

ActionScript 2.0 :: OnPress Function Doesn't Work

Sep 10, 2007

my problem is that my onPress function doesn't want to work. Here�s the script: PHP Code:

[Code]...

the hilite function should let the buttons disable or not, but it just will not work.....

View 1 Replies

ActionScript 2.0 :: Why Won't The OnEnterFrame Work

Aug 11, 2006

[code]Why won't the onEnterFrame work?

View 1 Replies

ActionScript 2.0 :: The Movieclips Appear, But The OnRollOver,onRollOut And OnPress Do Not Work?

Nov 22, 2010

I've created three movieclips to select the next level, and these work fine the first time my game runs, but when I come back to them, after the first game is over and we're restarting, the movieclips appear, but the onRollOver,onRollOut and onPress do not work...

[code]...

View 2 Replies

ActionScript 1/2 :: Delete OnEnterFrame Does Not Work

Dec 14, 2009

trying to stop the onEnterFrame loop but it won't stop.

[Code]...

I'm trying to exit the loop and go to frame openWin but that doesnt jumps so I tried to delete the onEnterFrame but the loops contiues.

1) how can I exit the loop to frame openWin? thats most importent it's what I need!

2)if I dont use this.onEnterFrame = function(){ just earth.onRelease = function doent work either unless its in the onEnterFrame why? the earth has animation on it but here i'm using it just as a button so I see no conection to why it isnt working unless its in the onEnterFrame?

View 3 Replies

ActionScript 2.0 :: Classes > OnEnterFrame Doesn't Work

May 7, 2005

I made a class named "fo" :

Code:
class fo {
function onEnterFrame(){
trace("HERE");
}
}

the swf file calling this file had:

Code:
var tr:fo = new fo();

Now when i run this swf ... it traces nothing ... ?( The as file is named fo.as and is in the same foledr as the swf file )

View 10 Replies

ActionScript 2.0 :: XML OnPress - Call Full Image And Try To Upload Doesn't Work

Sep 10, 2008

i have a little trouble with my xml menu, i have this code, but went i call my full image and try to upload doesn't work. I try to put my full image in and Movie Clip with the name of contenedor. But appear a message saying "Error opening URL All work perfect less the onPress.

[Code]....

View 1 Replies

ActionScript 2.0 :: OnEnterFrame Inside Prototype Doesn't Work?

Aug 22, 2005

Check my little piece of code. Everything's going well, until the onEnterFrame. My MC instances aren't doin' anything!

Code:
colors = [0x66FF00, 0x20DFD0, 0xEE1164, 0xDAE31C];
MovieClip.prototype.drawCube = function(_moveY, _amount) {
for (i=0; i<_amount; i++) {

[Code]...

View 11 Replies

ActionScript 2.0 :: Onpress Button - Clicking On The Button Movieclip Moved To X = 100

Jan 17, 2010

how to do so by clicking on the button movieclip moved to x = 100; and when pressed repeatedly to x =- 150 event onRelease - not work:

[Code]...

View 9 Replies

ActionScript 2.0 :: OnEnterFrame Doesn't Work For A Clip Loaded With LoadMovie

Aug 9, 2004

I haven't been able to find documentation on why loaded movies via 'loadMovie' into another movie clip don't seem to obey onEnterFrame commands. The following code represents a movie clip, 'container', which has a loaded external .swf file, 'box.swf'.

I have set the container to begin a decreasing alpha change. I've also added a trace to see if the onEnterFrame is performing at all. What happens is that the box does not appear to have an alpha change. There is, however, a trace that returns an output of '100' only. But no other numbers, suggesting that the command has stopped.

// Start
container.loadMovie("box.swf");
container.onEnterFrame = function () {

[Code]....

View 6 Replies

ActionScript 2.0 :: OnEnterFrame Doesn't Work For A Clip Loaded With LoadMovie?

Aug 9, 2004

I haven't been able to find documentation on why loaded movies via'loadMovie' into another movie clip don't seem to obey onEnterFramecommands. The following code represents a movie clip, 'container',which has a loaded external .swf file, 'box.swf'.I have set the container to begin a decreasing alpha change. I've alsoadded a trace to see if the onEnterFrame is performing at all. Whathappens is that the box does not appear to have an alpha change.Thereis, however, a trace that returns an output of '100' only. But noother numbers, suggesting that the command has stopped.

// Start
container.loadMovie("box.swf");
container.onEnterFrame = function () {

[code]......

View 6 Replies

ActionScript 2.0 :: SetTimeout Command - How Does This Work

Feb 4, 2009

I am trying to get a handle on the setTimeout command and I can't seem to get it to function at all. As a test I set up a simple movie where two objects fade in, one after the other. But whatever I try, they both fade in together.

Code:
_global.setTimeout()
stop();
onLoad = function(){
box1_mc._alpha = 0;
box2_mc._alpha = 0;
[Code] .....

View 3 Replies

ActionScript 2.0 :: Cannot Get The ClearInterval Command To Work

May 25, 2009

I cannot get the clearInterval command to work. I have a panel that is tweening down into the stage about 4 seconds after the movie loads and then I do not want it to happen again. Right now the panel continues to tween in everytime I close it. Right now, the clearInterval is not working.

var down:Boolean;
var currentInterval:Number;
down=false;

[Code].....

View 1 Replies

ActionScript 3.0 :: Stop (); Command Won't Work On Mask

Nov 15, 2009

I checked out a lot of sites but can't figure out how to do this. without the mask my animation of a button growing bigger works well, the stop command is respected. But i want an image inside the form of the button that grows larger, so i took a picture on a layer below it, and made the button into a mask. visually, it works fine, but it loops, since the layer in mask mode doesn't respect the stop ();

View 1 Replies

ActionScript 2.0 :: OpenURL Command Does Not Work Consistently

Dec 27, 2011

I have several buttons in my Flash file that direct to an external URL with the openUrl command. That always works. However, in some cases I used _self to open the new URL in the same tab, and in other I used _blank to open it in a new tab, but that doesn't work consistently. Sometimes the one labeled _blank opens the URL in the same tab, and vice versa. Is there another way to define whether I want the new URL to open in a new tab or not?

View 2 Replies

ActionScript 3.0 :: OnEnterFrame - The OnEnterFrame Is Not Triggered Automatically By Flash Player At Run Time

Feb 1, 2010

i'm very new to Flash (although have plenty of experience in Java, C++, PHP, etc). For a University assignment, I am creating a World Cup Guide and i'm creating a countdown to the tournament. I've followed a tutorial and modified it slightly but i'm receiving an error message. The error message is:

[Code]....

View 1 Replies

ActionScript 2.0 :: Preloader Causing The Stop Command To Not Work

Jan 5, 2009

I am using CS3 actionscript 2. I am having trouble with the preloader. It works, but it is causing the stop commands throughout the rest of the movie to not work. I know it is the preloader because when I remove it, it works. It is just a basic preloader. index12.fla has it with the preloader and index13.fla doesn't.[URL]...

View 3 Replies

ActionScript 3.0 :: When Load .swf Into Main Swf The Stage Command Does Not Work

Dec 14, 2009

I use stage in my scrollbar: this.stage.addEventListener (MouseEvent.MOUSE_UP, stopScroll); When I load this .swf into my main swf the stage command does not work. I still want to use stage, is this possible?

View 4 Replies

ActionScript 2.0 :: Cancel A Button's OnPress Action?

Feb 25, 2009

I wondering if there is a way to cancel a button's onPress action.For example on my button I have the following:

Code:

on (press) {
startDrag(this, false, 384, 2.5, 384, 70.5);
}

[code]....

However if you press the button and roll out with your mouse button still held down it will continue to drag even after you release the mouse button. It then won't stop dragging until you roll over and then out of the button.

To correct this I was wondering if there is a way to call the on(Press) action and stop it OR to activate the on(release) or on(rollOut) actions OR a way to activate "stopDrag();" when the user rolls out even if they are still holding the mouse button down.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved