3 MovieClips - Using IF Function With Two Conditions
Feb 2, 2011
I ve used next script:
onClipEvent (load) {
if((_root. mc1._visible=true) and (_root.mc2=true)) {
_root.mc3._visible=true;
}else{
_root.mc3._visible=false;
}}
To achieve next: mc3 is visible only when mc1 and mc2 are visible else its hidden, but this dont work, with this script on load all clips are visible on stage mc1, mc2, mc3, inspite there is a script which is hiding mc1, and mc2...(they should appear on stage on mouse event and this was ok before a inserted script from beginning of post, now they are always visible). How should I write this to make mc3 visible only when mc1 and mc2 are both visible on stage.
I've got a function which is constantly running to see if a set of movie clips (ball0_mc, ball1_mc etc.) have been placed in a target zone. Once the ballPlaced[#] value is true for a partiuclar moive clip, the movie clip starts acting in different ways depending on which other balls have been placed in a target zone (i.e. their ballPlaced[#] value is also true).
The 'if' and 'else if' conditional statements are contained within the playVideo() function which is constantly running through the ENTER_FRAME event. [code]...
I have a combo box in my application. I also have a variable called "Status". I want the combo box to be enabled only when the value of the Status variable is 5 or 6. Otherwise, I should not be able to change the value in the combo box. It should have the previous value only.. I had written a click event to disable the combo box. But even though the combo box is disabled, I get the drop down list of the combo box, and If I select some othe value in the drop down,it changes..Only after that it gets disabled.
I'm doing a basic site with frame labels on the main timeline whose name corresponds to the btn names. A simple otoAndPlay(evt.target.name); I have a basic navigation setup of 7 mcs with mouse eventlisteners for CLICK, ROLL_OVER and ROLL_OUT.
Does anyone know a better way to do this so when my mcs are clicked they display the rollover content/art? In essence I'm trying to achieve that when the user clicks a btn it goes to that "page" and the corresponding btn stays highlighted. Pretty standard web navigation technique but I just don't know what the best way to do this in flash is and with how my site is setup.
trying to use a function on 7 movieclips..wrote it all down with 7 individual EventListeners..but it can be much easier.Tried this, but that won't work..trowing me an error:
TypeError: Error #1006: hitTestObject is not a function. at new_fla::MainTimeline/endDrag()
ActionScript Code: import caurina.transitions.*; var cirX:Number = 60; var cirY:Number = 60;
[code]....
So I've got 7 movieclips named Object1, Object2....Object7, and when I click on one the movieclip has to stick on the mouse and if it is released nearby the target movieclip it has to stick to it. If it is not nearby it has to go to a random place..
All works fine like this:
ActionScript Code: import caurina.transitions.*; var cirX:Number = 60;
I have 3 movieclips on my main timeline - 1 MC for each frame. The movie clips are named image1_mc, image2_mc, image3_mc. I want to have all 3 mcs have this code on them:
I'm adding movieclips from an external .as class called GUI. But what I'd like to do is be able to load multiple GUIs - lets say GUI0, GUI1 & GUI2 - through the one class using a dynamic variable. So if I need to load a certain GUI i can just instantiate the GUI class and run newGUI.loadGUI(GUIname); and have it load the correct movieclip based on the variable.So, syntax aside, it would look something like this:
Code: loadMenu(GUIname) { GUItoLoad = GUIname; var mcLoader:GUItoLoad = new GUItoLoad();[code]........
I've tried a few different things syntax wise, and have had a search and browse, but have come up empty handed.
Is there a way how the startDrag function can be used on 2 different movie clips on one stage?
I have my own photo slideshow player (photos + music) and I need 2 dragable movieclips (buttons). First one is on the timeline and second one on the volume slider. How to achieve that I could use the startDrag function on both of them in the same time?
Or is there any trick how to do it? A regular youtube player has 2 dragable buttons (volume, timeline) also...
I am creating an interactive map which is attached, what I want when you hover over any movieclip the alpha decreases and when you mouse off it goes back to 100% aplha. I can certainly do this, but I only know how to do it by referencing each movieclip first! For example:
I'm trying to apply a function to an array of movieclips, rather than have to type out the function for each one. So, if my movieclips were mc1, mc2 and mc3, I would have:
Code: function Invisible (movieclip){ movieclip._alpha=50; }
[code]....
This does not work - I still have to put Invisible(mc1) for each object to make it work. Is there a way to use arrays to do this?
Not all of them only a snippet. Is there a short way of doing this. The only prob is each function will have a completely different piece of code in it eventually doing different things. I have 20 mc with 30 btns in each.
I have yet another "I die-problem", not so drastic this time, though. I've only tried to solve it for two hours or so,it's killing me Well, as usual, I end up here, at the Kirupa forums.. and of course, l end up emptying the coffe-machine at work.. *runs for more espresso* It's an issue regarding the duplicateMovieClip function. I know how it works, and I know how to duplicate MovieClips using the function, however, I do have an issue figuring this out: Now, explained roughly:I have a MovieClip which contains yet another MovieClip. I want to duplicate both the MovieClip and it's child, but I want it to stay inside the parent MovieClip, just as the original MovieClip contained the original child.
I'm adding movieclips from an external .as class called GUI. But what I'd like to do is be able to load multiple GUIs through the one class using a dynamic variable. So if I need to load a certain GUI i can just instantiate the GUI class and run newGUI.loadGUI(GUIname); and have it load the correct movieclip based on the variable.
i have 4 movieclips on stage and i want to apply a drag function for each separately but i was wondering if there's a way to make this simple. and not to write a function for all 4 movieclips.
I have created 3 movieclip buttons which have a total of 3 states eachUP, OVER and Pressed.What i am wanting to do is create a fuction that will change the state of an already pressed button back to its UP state. For exampleButton one is press and will stay in its state untill button 2 or 3 are presses then it will revert back to its up state.My way of tackling the problem was to target a frame in the movie clip that I wanted to change such as this:
I've got two functions that work separately, but don't like to work together. Specifically, function "onEnterFrame" stops working after function "connectT."
function onEnterFrame(){ connectT(); checkBounds(); }
I used a tutorial to attempt to set up my code so that after a button is released and an external .swf is loaded the same button can't be activated again (on release or on rollover) until a different button is released.
Here is an example of my actionscript. What I'm trying to do here is just have the button not replay the mc in the over state if it's movie clip is already loaded in[code]...
Depending on the time of day (user machine time) and the amount of money raised the header needs to show different scenes and building construction progress.1. Is there some example script out there that would conditionally call on 1 of 4 times of the day (morning, noon, late afternoon or overnight) for me?2. And the % of the funds raised (variable data passed from the site?) will reveal that equivalent portion of the building constructed. So if 25% of the funds are in then 1/4 of the building will be shown completed. Is there an example script that would receive that data from an external source and then call 1 of 4 pre-built building movie clips?
I have several input text boxes all of which are activated by the use of the enter key. I only want the one the user is using to run its script when they press enter instead of the keylistener on all of them picking up when enter is pressed. I have tried
ActionScript Code: listenForEnterObject = new Object(); listenForEnterObject.onKeyDown=function(){
I have some code that needs to read like the following:IF the original position(origX) DOES NOT EQUAL where my object is(this._x) AND delay variable(delay) is set to 0, then I need to display a movieclip. There is an X on the movieclip so users can close it, and when they click the X, the delay variable is set back to 1, so the movieclip won't keep loading.
ActionScript Code: var delay = 1; if (origX == this._x && delay == 1) {
So the way I see it, there are three conditions in a drag/drop assessment situation; The dragged object is on the correct drop targetThe dragged object is on an incorrect drop targetThe dragged object is not on any targetAssuming there are multiple drag and drop targets, I can do this, but it only satisfies the first two condition:
ActionScript Code: function stage_onMouseUp(event:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp);
I'm having a strange problem w/ race conditions when using attachmovie. I have a class linked to a movie clip that I'm attaching to the stage. The class is fired off when the movie clip is attached but also other classes are getting loaded at the same time while the movie clips is attached. Even though the other classes are called after the movieclip is attached, they are getting loaded faster and therefor the class linked to the attached movie clip cannot access their functions. I'm looking for a listener that will fire off an event ONLY when the attached movieclip is fully loaded but I can't seem to find any examples of associating a listener to a attachmovie method.
I want to set multiple conditions for an if statement, but I don't want the conditions to all have to be true, I want to say if (a or b or c or d, etc. is true) then do this. I don't want to say if (a && b && c && d, etc. is true). Is it possible to have an if statement with an "or" in the condition? If so, what's the proper syntax for that?
I have made a scrolling gallery with an area described by a variable called 'thumbVar' which excludes the area above and below the scrolling thumbnails from activating the scroll left or right (excluding the area above and below the thumbnails).
Could someone have a look and at the code and see why the 'thumbVar=true' does not work? Is it because I cannot us two parameters within the variable? The strange thing is that the swf does behave properly when first loaded until the cursor moves out of the thumbnail mc. i.e. at first it works, then stops when moving off the thumbnail mc.