ActionScript 2.0 :: Using A Function Over Multiple Mc's?

Sep 19, 2009

I have created a file that displays Home and Away team names by using an mc that has 2 dynamic text fields "home" and "away". This mc is copied and pasted below the one above and each of these mc's has the following action:

ActionScript Code:
onClipEvent (load) {
gameNo=0;

[Code]....

I can't get this to return the required values.

View 7 Replies


Similar Posts:


IDE :: One Function, Multiple Buttons

Nov 16, 2008

I have three buttons. My goal is that each button will load and play a sound file from the internet. Here is what I have:

function loadPlaySnd(pSpecifier1:String):void {

arguments;

SoundMixer.stopAll();[code]....

Every Button I press goes to the same sound file. The best I can figure, is that the file I loaded the first time I pressed a button has been uploaded, and from there I cannot load another file over that variable when I try another button.

View 2 Replies

IDE :: Control Multiple MCs With Function?

Nov 26, 2009

I have a keyboard which consists of 26 MCs, named keya, keyb, keyc.... and so on.

I want to create a button that will disable all these buttons at once, but I'm not sure how to express it in actionscript. Basically, I need it to say 'on release, key X (where x = all characters from a to z) _enabled= false;

View 3 Replies

ActionScript 2.0 :: Same Function On Multiple Objects?

Apr 28, 2009

I am building a scrolling image bar, so I've created code that works perfect on one object. However, I need this code to apply to multiple objects at once so that they will move left and right and resize independently from each other (to give this sort of 3d revolving look). Other boxes will be to left and right of the current black box. Code is below as well as link.

Code:
function mousetracker(object){
boxstartx=object._x;
boxstartwidth=object._width;

[code]....

View 1 Replies

ActionScript 3.0 :: Use A Function In Multiple Scenes?

Feb 27, 2009

I have a .fla project being created under CS4, using ActionScript 3.0, that consists of multiple scenes.

In the code attached to the first scene, I define some functions that are used as methods on buttons[code]...

View 1 Replies

ActionScript 3.0 :: Multiple Buttons With Same Function

Jul 24, 2009

I have a group of 50 buttons (named Bottle01 > Bottle50) that I want to have the same code on. The code I want is to, when pressed, put the buttons individual name into a variable and then move to a point later in the timeline. I have just started using as3 as I need this to work through Air and have been googling all afternoo and have cobbled something together, but it doesn't seem to work that well. This is the code I have sofar which is probably very wrong:

[Code]...

View 2 Replies

ActionScript 3.0 :: One Function For Multiple Keys?

Dec 21, 2009

I'm building a menu for a website that plays a sound each time you mouse over one of the buttons. (each button is a piano key) I've written two functions that change the size of each key on ROLL_OVER and ROLL_OUT events. What I want is someway to play a unique sound in my library for each key, without writing a separate function for each key. Either a new function, or just written into my existing ROLL_OVER function. Currently, it plays the same sound for every key.

Here is a zip of my project

[URL]

What I've got in there is a fla file called menu.fla In that file there is a movieclip on stage called "keyboardmenu" and inside that movieclip are 8 movieclip's (my buttons) each with a unique instance name. In the library there are 8 mp3 files with class name keysound1, keysound2 etc...Here is my code: ( I'm using tweener to handle the scaling. )

Code:
import caurina.transitions.Tweener;
function keyisdown(e:MouseEvent):void{
Tweener.addTween(e.currentTarget,{height:185, width:80, time:.25, transition:"easeOutBounce"});
varsound1.play();

[code]....

View 3 Replies

ActionScript 2.0 :: Multiple Intervals For One Function?

Jan 18, 2011

I've got one function that I'm running, but I need it to run at different times for different movie clips.Here's my code. What is wrong with this?

ActionScript Code:
function tweenText(_TEXT:MovieClip, _START:Number, _END:Number, _SEC:Number, _INTERVAL:Number) {
var xTween:Tween = new Tween(_TEXT, "_x", Strong.easeOut, _START, _END, _SEC, true);
clearInterval(_INTERVAL);

[code]....

View 2 Replies

ActionScript 3.0 :: Multiple NavigateToURL In Same Function?

Apr 22, 2011

Having an issue with having multiple navigateToURL in the same function. Only one seems to fire. Any ideas? Here's the code.URL...

View 3 Replies

Actionscript 2.0 :: One Function For Multiple Clips?

Jan 11, 2010

I have 1 button (instanced : but)and 3 movie clips (instanced : mc_test, mc_clip, mc_example)when I release the but, I'd like 2 clips to move down (200px) and 1 clip to move up (200px)I'd like it to look like that

Code: Select allfunction down():Void  {
_y=_y + 200;
};

[code].....

View 6 Replies

Actionscript 3.0 :: Using A Function On Multiple Frames?

Feb 1, 2010

embarrassed to ask becasue i know its gonna be something simple i over looked. This is what im trying to do i have a movie clip that i want to use as a home button and i want this clip to be on every frame of the movie. well i created a function that whenever this clip is clicked it returns you to the second frame of the movie. now i declared the function on frame 2 when i try and call it from frame three it gives me a 1084 error. Is it even possible to call a function like that from a different frame? This is the actionscript i have in frame 2

stop();
home_btn.addEventListener(MouseEvent.CLICK,homeClick);
about_btn.addEventListener(MouseEvent.CLICK,aboutClick);

[code]........

View 1 Replies

ActionScript 2.0 :: [FMX] One Function For Multiple Buttons?

Oct 22, 2004

I am building an interactive world map, and for ease of updating am slapping all the functions in a frame on the main timeline.

Say I have a the word "Belgium" with a generic button symbol underneith it (instance name of Belgium of course), and also the maps shape of Belgium, as a button labeled, say Belgium_Map , each requiring several functions for rollovers, movement etc, is it possible to simple write one expresion and apply it to both buttons?

My code looks something like this:

buttons.belgium.onPress = function(){
map:scale_target = "250";
map_target = "-1050";
map:y_target = "-280";

[code]....

So can I apply it to my completly separate button with the path map.europe.belgium as well, without having to write out all that crap again for each, when they execute the same things?

View 2 Replies

ActionScript 3.0 :: One Function For Multiple Movieclips?

Mar 28, 2011

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.

View 2 Replies

ActionScript 2.0 :: {FMX} One Function For Multiple Buttons?

Oct 22, 2004

Say I have a the word "Belgium" with a generic button symbol underneith it (instance name of Belgium of course), and also the maps shape of Belgium, as a button labeled, say Belgium_Map , each requiring several functions for rollovers, movement etc, is it possible to simple write one expresion and apply it to both buttons?Im sure, like most things that one gets stumped on, it is pretty simple, however Im not sure of the syntax..My code looks something like this:

buttons.belgium.onPress = function(){
map:scale_target = "250";
map_target = "-1050";

[code]......

View 2 Replies

ActionScript 2.0 :: Getting Multiple Things To Happen In One Function?

Mar 23, 2005

I'm trying to make this script work in which two things should happen onRlease of a movie clip. In the script below, the "transition" plays but frame 18 doesn't..even though the path is right. I even tried frame label even that doesn't work. The script is on the clip itself.

_root.navbtns_mc.webnav.onRelease = function() {
_root.transMC.gotoAndPlay("transition");
_root.navbtns_mc.webnav.gotoAndStop(18);
}

View 10 Replies

ActionScript 3.0 :: Abstract Multiple Buttons To Use The Same Function?

Jul 16, 2009

I'm building a demo that has a keyboard in it. Obviously, people will type stuff with it and it will go into a dynamic text field. So I have a full keyboard (a movie clip named "keyboardStandard") made up of button symbols. That is placed in the same frame as the text field. Then I wrote this code, using the Q key ("keyQ"):

Code:

keyboardStandard.keyQ.addEventListener(MouseEvent.CLICK, addQ);
function addQ(ev):void {
enterPlayerID_txt.appendText("Q");
}

This works just fine, the Q goes into the text field. However, I sure as heck don't want to write 26 event listeners, then 26 more functions, even if it is copy paste. That's just gnarly. Plus, there are actually 3 keyboards - a numeric and special char one as well I need to handle.I seems passing a parameter from the event listener is not doable?

View 4 Replies

ActionScript 3.0 :: Multiple Arguments Inside One Function?

Oct 12, 2009

lets say I define a function that does a simple trace of the arguments it takes in, now is it possible to have multiple arguments? like sometimes i want to send in a String argument, sometimes a Number, and sometimes an Array.Do I need to create the same function 3 times to accommodate for the 3 different inputs or is there a way I can keep one function but send one of the 3 values.

View 3 Replies

ActionScript 3.0 :: Cleare Multiple Textboxes With 1 Function?

Feb 28, 2010

Is if i have a textbox, name_txt, i can clear it with a function[code]....

which is great, but i don't just have one textbox. i have lastName_txt, age_txt, etc. how can i reuse my one function for multiple textboxes?

View 2 Replies

ActionScript 3.0 :: Get A Function Triggered By Multiple Triggers?

Jul 16, 2010

How can I get a function triggered by multiple triggers? For example, a function that is normally triggered by a condition but also needs to be executable independently with a mouse click.

View 3 Replies

ActionScript 1/2 :: Unified Rollover Function On Multiple MC's

Nov 4, 2010

I'm trying to code a variable rollover for a sequence of MCs on the stage. I have 3 buttons (MovieClips) on the stage and each time one is rolled over I'm making a different movieclip appear.
 
So I've done this in a root timeline frame script:

//put an empty container movieclip on the stage
containerMC = _root.createEmptyMovieClip("container", this.getNextHighestDepth());
//button 1  - "but1" is my linked instance name and Content 1 is my content movieclip

[Code].....

and so on for each button (1, 2 and 3). As you can imagine if there were 20 buttons there is a lot of uneccessary duplication.
 
What I've considered is, as they are sequential I should be able to read "but"+i and "content"+i and I could push the button names and content names into an array. The thing I'm having trouble with is, how do I write the function so it checks which clip is rolled over and then attaches the corresponding content movieclip?
 
Ultimately I would like the script to check how many buttons there are on the stage and simply iterate for that number (so I don't have to specify how many there are to loop through i.e. numOfButtons = 4),  But not sure how to go about it.

As you can see the code could be the same for each button, if I could read the movieclip rolled over and attach the function variably.
 
In summary what I'm trying to do is have a single function for all rollover buttons named but1 to but n.

View 8 Replies

ActionScript 3.0 :: Return Multiple Variables From A Function?

Jul 21, 2011

As seen below, I tried to return more then one variable from a function but , I think I have some syntax problem..
 
function hesapla3(parametre1,parametre2):(Number&&Boolean) // PROBLEM IS HERE, I NEED TWO VARIABLES TO RETURN{var yenideger2:Number=new Number();var bol2:Boolean=new Boolean();yenideger2=parametre1+parametre2;if(yenideger2>80){bol2=false;}return yenideger2;return bol2;trace(yenideger2);trace(bol2);}

View 3 Replies

ActionScript 1/2 :: Single Function For Multiple Buttons?

Feb 21, 2012

My problem is that I am trying to use the following functions on 10 different logo movieclips. Each logo movieclip has a popup up box (another mc) within its timeline with a description in. When I hover over the logo movieclip i want it to call the forward frames function and on hover out call the rewindframes function.

function forwardFrames() {
onEnterFrame = function () {
if (_currentframe != 15) {
nextFrame();

[code]....

View 4 Replies

ActionScript 2.0 :: Multiple MCs Using The Same Instance Name - Only 1 Of Them Working For The Function?

Nov 17, 2010

Got 9 MCs which I want a rollover effect for. I made 1, copied it and it's instance name 9 times. And made this script:

Code:
function menu_btn_over() {
myTween = new mx.transitions.Tween(_root.main.menu.btn.btn_parent, "_x", mx.transitions.easing.Strong.easeOut, _root.main.menu.btn.btn_parent._x, 0, inspeed);

[code]...

But it only works for one of the buttons. The one I made the copies from.I figured you could do this since it's the same MC? I could be wrong though. If that is the case, is there some way I can make the same action for every button without having to make a bunch of calls for each one? for example:

"_root.main.menu.btn1 <and> btn2 <and> btn3 <and> etc.onRollOut = function() {"

View 1 Replies

Actionscript 3 :: Load Multiple Bitmaps With The Same Function?

Mar 15, 2012

i got a basic problem with loading a Bitmap from a URLRequest.The problem is, that loading a Bitmap is to much code to write it every time I want to load an Image. So i thought about some function:

var bitmap1:Bitmap = bitmapForURL("test1.gif");
var bitmap2:Bitmap = bitmapForURL("test2.gif");
function bitmapForURL(url:String):Bitmap

[code]......

View 1 Replies

ActionScript 3.0 :: Return Multiple Values From A Function?

Feb 6, 2009

I'm pulling info from an XML file... there are three variables (year, month, day) that I need to process further in another function, but I can't figure out how to send them out of the function and into the next for processing.

Is it possible to make their values globally accessible?[code]...

View 9 Replies

ActionScript 2.0 :: MC Timeline Function To Act On Multiple Instances?

Sep 15, 2009

I've got this on the timeline of an MC:

_root.seQ1MC.b_seQ1yes.onRelease = function(){
tickVar = _name;
//trace("local tickVar = " + tickVar);
//trace("this tickVar value = " + _root[tickVar]);

[code]....

I want it to act on all the instances of the movieclip it is contained within. It is only acting upon the last of the instances that was loaded or had focus... I'm clearly missing something or am trying to achieve something that isn't capable of working...

View 1 Replies

ActionScript 3.0 :: Single Function For Multiple MC's, Change X, Y?

Oct 12, 2009

I have 16 movieclips, each with different instances and linking to htmlsI owuld like to have it so that when you ROLL_OVER a movieclip, they shift position 1 along the x and 2 along y axis.I've given each MC a ROLL_OVER event listener and know I could call separate function for each but I'm sure there's an easier way.This is what I have already have

Mc1.addEventListener(MouseEvent.CLICK, go1);
Mc1.addEventListener(MouseEvent.MOUSE_OVER, nudge);
Mc2.addEventListener(MouseEvent.CLICK, go2);

[code]......

View 2 Replies

ActionScript 3.0 :: Play Multiple Video In Function?

Feb 6, 2010

I am trying to play a brief clip of a door closing when a button is clicked before it moves on to the next page.[code]...

View 1 Replies

ActionScript 3.0 :: Giving Multiple Instances Same Function

Sep 10, 2010

I imagine this has been asked before but forgive me, the search feature seems not to be working for me; and despite working, google search isn't helping much either.I simply would like to apply the exact same action to multiple buttons without re-writing the same thing (n) times. For example: I have 8 or 9 buttons that on mouseOver and mouseOut will have performed identical functions, though the graphics in their corresponding keyframes may or may not be discrete from one another.So, is there a short way to write this, like say (imaginative I know...):[code]

View 4 Replies

ActionScript 2.0 :: SetInterval For Multiple Clips In One Function?

Apr 7, 2011

My issue is that I want to set up a system whereby I can register clips to a class that will have certain properties set and then animate changes in those properties. Namely, each clip is placed at a different _y position at authoring time, then at run time be repositioned at a different _y position, only to be animated back to the original position. I want to do this so I can edit the clips in their destined places to layout their positioning.

Visually, my code works fine but, as is apparent from the "trace("muvUp "+thing);", the interval isn't being cleared. And what's worse � at around 40000 (of getTimer()), the clips start disappearing.

I've attached a file but here's the code I'm working with (as you can see with the lines I've commented out, i've tried a few different options):

//MY CLASS ON FRAME 1:
function wordsClass(){}
wordsClass.prototype = new MovieClip();
wordsClass.prototype.onLoad = function(){

[Code]....

View 9 Replies







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