ActionScript 2.0 :: Cannot Call MovieClip Within Button
May 26, 2010
I have to do a Flash ad in AS 2 with a button that flashes a few times (with a delay) and then stops. I've made this as a movie within a button in the main time line. The only ActionScript in the movie is a stop(); on frame 1, and a gotoAndStop(1) on the last frame. The second frame of the movie is labeled "playShine." In the main timeline on the actions layer, I try to play the movie using:
traceNow_btn.shineNow_mc.gotoAndPlay("playShine");
But the movie won't play. The button name, the movie name, and the frame label are all cut and pasted from the actual instance/label names. (It does play once if I remove the stop() on the first frame, so it must be something about the call that's not working). I've tried substituting gotoAndPlay(2); but that doesn't work either.
View 1 Replies
Similar Posts:
Oct 28, 2009
I have a mailTo: function that needs to be added to a button that sits inside of a movieclip. I put the code inside the actionscript layer in the movieclip.[code]...
View 2 Replies
Oct 4, 2010
I'm having a bit of a hard time with calling a function in the main timeline through a button in a movieclip. The mc is in the main timeline and in it I added a button with this.removeMovieClip(); and so far it works, but when I try to call a function from the main timeline it just doesn't seem to work.
View 13 Replies
Mar 10, 2012
I have an Arrays that contains the names of MovieClips:
Code:
var MyMCs:Array = ["A","B","C","D","E"];
The actual MovieClips names are "MC_A", "MC_B", etc..., I use this method so I reuse the same Array for multiple tasks, I simply add what ever it's needed to the name to match the task at hand. On this case I add "MC_".
Then I have multiple Arrays, with the same names of the values of MyMCs. The values of each these Arrays are the names of buttons that are inside the movieclips of MyMCs:
Code:
var A:Array = ["RR","TT"];
var B:Array = ["YY","UU"];
etc...
I could add a listener to a button this way:
Code:
MC_A.YY.addEventListener(MouseEvent.CLICK, DoSomething)
My problem is that i want it to be done dynamically, using the Arrays values in a loop to add Listeners to the all buttons. The loop system is not a problem for me... my real problem is in the dynamic attribution itself.
Here is what I have:
Code:
//'i' and 'j' have previously been created
for(i=0; i<MyMCs.length; i++){
for(j=0; j<this[MyMCs[i]].length; j++){
[Code]....
I know that this is correct since I tried them separately and I can trace the proper values.
I know that my problem is in the "this" since I get an error message stating:
1084: Syntax error: expecting identifier before this.
I suppose it should state something else... I tryed with "root", "parent", "child", "MovieClip"... with no luck...
View 2 Replies
Nov 2, 2011
I'm having trouble simulating a click call to a button(displayObject) thats generated via an API call( youtube as3 API). I have not seen any mention of security reasons as to why I can not simulate a click as long as something is registered with a click handler. Basically I checked to make sure the button made is listening to a mouse click event with:
trace(generatedButton.hasEventListener(MouseEvent.CLICK)) which returns true
I proceed to than call this:
generatedButton.dispatchEvent( new MouseEvent(MouseEvent.CLICK, true) );
And nothing happens yet if I physically click the button it works. Is there some security measure that prevents something from being fake clicked unless its origin is strictly from the system mouse?
I even set a timeout call on the click function and moved my cursor over the button and let it fire in case it was an issue of the mouse having to over the object but still nothing. I am kind of stumped at this point.
View 4 Replies
Mar 13, 2009
I'm pretty new to AS3 and am getting my feet wet as fast as I can. Currently I have a fairly simple thing I'm trying wherein I will have a button_mc that on ROLL_OVER, it triggers a function that will make another MC move. That part I can do- my question though is how can I have multiple button/movieclip "sets" that are able to call the same function? As an example, I'd have "button1_mc" trigger "shape1_mc", "button2_mc" trigger "shape2_mc", and so on. I want to avoid having to have separate sets of functions for each button/movieclip pair. I hope that makes sense.
Here's where I'm currently at with the first eventListener and corresponding function. You can see how in the function I have a specific MC (shape1_mc) named, which of course I'm trying to avoid, as I will likely have 5-10 similar buton/mc pairs like below. Is there a way to call the movieclip (shape1_mc) in the event handler itself without having to name it in the function?
[Code]...
View 3 Replies
Oct 24, 2007
how do you call an onClipEvent(enterframe) of a movieclip to happen when that movieclip is pressed?
[Code]...
when i type this in i get an error because on events cannot be nested within other on events. how can you get around this?
View 10 Replies
Feb 2, 2005
If I have a piece of a function that is telling Flash to:
// show a hover color
var col = new Color(this.background);
col.setRGB(0xf4faff);
How do I tell Flash to call a MovieClip as opposed to setRGB for the background MovieClip?
View 4 Replies
Mar 15, 2012
I have load child swf in parent swf, from child swf i am trying to run my parent swffunction I am trying this code
MovieClip(parent).testfun()
but this code is giving error.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2b1aa061
[code].....
View 1 Replies
Sep 1, 2009
I have a movieclip on the stage(lets call that selection movieclip) that once a button is clicked is going to open another movieclip(call this slideshow) I am trying to remove the selection movieclip when you launch the slideshow movieclip.
Error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at mc_work/clickHandler3()
[Code]...
View 9 Replies
Jan 29, 2011
how to cal movieclip from stage to the movielcip which present in another movieclip
View 4 Replies
Feb 10, 2011
how to call a button. I have a main file ("AS3Build.fla"), which imports an xml file, and imports different swfs depending on which node in the xml is being referenced. One of the swfs("slide_01_03.swf") I'm importing has a button("btn_01_01") that I'm having trouble accessing. First of should the script for the button be in the swf that holds the button, or the main file that will be importing the swf? I've got it in the swf currently with a trace file to see if it's recognizing the click. So far not luck. So I'm starting to think it should be in the main fla, and be referenced something like: this.loader.addEventListener.btn_01_01. This doesn't seem to work either though.
View 1 Replies
Mar 5, 2010
I have a button with the following code.[code]How can I trigger this function from another button without having to rewrite all the code ?
View 2 Replies
Jan 26, 2011
I'm working on a project in Flash with AS 3.I'm making a application that contents a few pages.At first I have two labels: Home and Pages.Home contents 4 moviebuttons that I want to navigate to the different pages.The problem is in pages is one movieclip that contents 4 other movieclips.The reason of that is that 'pages' is a sort of slideshow that slides through the pages.So for example: when I click on the second moviebutton ! want to go to the second slide.How do I navigate to these movieclips.
View 4 Replies
Jun 28, 2011
i have some actionscript that makes a
ExternalInterface.call('someFunction');
call.is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call?
Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript.
Currently:
Actionscript source
ExternalInterface.call("someFunction");
ExternalInterface.addCallback("someCallback",someASfunction);
[code]....
View 1 Replies
Jun 5, 2011
I have 2 movie clips on the stage, and i need to call the 2nd movieclip from within the 1st one[code]...
View 1 Replies
May 1, 2009
i've got a function in a movieclip on the main timeline that i need to call when a button in another movieclip is clicked. is there a way to do this in as3?
View 3 Replies
Aug 14, 2010
I have want to tell a movie instance to play from a class:
`package com
{
import flash.display.MovieClip;
public class Global extends MovieClip
[code]....
pic1m is the class, but I get 1120 undefined property error.If I just put pic1m.play(); in my main timeline action layer it works fine, but I need the function playMask to be global in AS3...
View 1 Replies
Nov 18, 2010
I have a m.c. calling for a swf file as such:
Actionscript Code:
mcl.loadClip("splash.swf", emptyMC1);
How do I get it to call for a html file instead??
View 1 Replies
Sep 7, 2010
I have a button inside a movieclip, inside a movieclip, inside a movieclip, etc..So when I click the button, i want it to call another movieclip. The movieclip is inside the same movieclip as the button. So instead of doing _root.MovieClip.Movieclip,.. etc.. how can I do it?
View 2 Replies
Mar 19, 2012
My stage have 3 movieclip that is mc1,mc2 and mc3.each of them are now alpha=0.I have a button on stage too and when click on it, 1 of the movieclip will be change to alpha=1.
here is my script:
var mcArray:Array = [mc1,mc2,mc3];
for (var j:int = 0; j < hotSpot.length; j++)
{
mcArray[j].alpha=0;
[Code]...
View 2 Replies
Sep 12, 2011
I am trying to create a small game but would like to do the following:I have four Movie Clips, named rather imaginatively clip1, clip2, clip3, clip4.Now what I would like to do is store those MovieClip names in an array so that I can use them in a for next loop.
a[]=new Array('clip1','clip2','clip3','clip4');
for(n=0;n<a.length;n++){
// How do I call the MovieClip so I can manipulate it
[code]......
View 3 Replies
Aug 31, 2008
This is hard to explain, but basically here goes: have a "frame" movieclip that loads images. I call frame.loadImage(the URL) and everything works. So far so good.When I put "frame" inside of another clip, named "frameHolder", then call frameHolder.frame.loadImage, nothing happens.
View 9 Replies
Apr 12, 2010
I have a button that I need to call a URL. I am using the following script:[code]I don't get the "hand" when I hover over the button and, of course, it doesn't call the URL.
View 3 Replies
Sep 25, 2009
[Code]....
I have created a listener. I want to call this listener on click on the button. As like my_btn.onRelease = function(){//call this listener on click on the button.}
View 2 Replies
Sep 19, 2009
I just want to ask if is it possible to call a movieclip using the String Class together with it's instance name to use gotoAndPlay() method.
I know how to use the instance name and the method but then what if I want to use a string together with the instance name and the gotoAndPlay.
View 4 Replies
Dec 14, 2009
I'm inside the movieclip called 'infopanel', and in its timeline im trying to allow it to be moved up when an identically sized box (also inside the infopanel movieclip) is rolled over. The reason I'm doing this is because the movieclip has to be summoned by code, therefore all its functions have to be inside itself.[code]...
View 1 Replies
Aug 2, 2009
on the mainTimeline if have a movieclip. inside this movieclip i have a script that loads text from database. what important note is: var myPageText: String
now if i place inside this movieclip a other label further in the time, and create a action to call out myPageText like: my_input_text.htmlText = myPageText; this works fine
now i want this to work inside a other movielip in other scene. is it possible to call myPageText???
View 11 Replies
Jun 4, 2010
If I have function_2 nested inside function_1, how would you call function_2 from another movieclip on the same timeline?MovieClip(parent).function_1().function_2()-I know that's incorrect, but just to illustrate.
View 2 Replies
May 16, 2011
I'm adding a movieclip element ("lastSlide") to an other movieclip element("endLogoButton"). The added element has a child which is a button("endLogoButton"). How can I call that button?
mcSlideHolder.addChild(lastSlide);
/*mcSlideHolder.getChildByName("endLogoButton").buttonMode = true;;
mcSlideHolder.getChildByName("endLogoButton").mouseChildren = false;
mcSlideHolder.getChildByName("endLogoButton").useHandCursor = true;*/
lastSlide.endLogoButton.addEventListener(MouseEvent.CLICK, linkClick);
It always tells me that the access to a Nullobject reference is not possible.
View 2 Replies