ActionScript 3.0 :: Controlling A MC From Within A Function?
Oct 20, 2008
I dont really know if I can put this into words correcly so I'm including enough code(AS3) to show what I mean. I can see the results from my trace statement so I know my function is ok, but I'm seeing an error once I try to make my MC disappear. Need something inplace of "this.lowerThird_mc.visible = false;". Also, I should note that this code is in a MC that is on the stage where the other MC is.
function onCuePoint(infoObject:Object):void
{
if (infoObject.name == 'CuePoint5')
{
i've defined a Tween object within a function, and i want to control that tween from another function.
This is the basic way i have the code set up currently:
// Define the function with my tween: function updateSlide() {
[Code].....
Now i'm sure it's not working because it's not within the same function, but what would you do to make this work? Some sort of global variable or global function? I'm not used to working in AS2, or with programming in general
Have been struggeling for days now , I have in the _root a function called elastic and then on the stage a movieclip containing 9 smaller clips called t1 --> t9, these movieclips are each at a different y-axis and when this function is called they appear (slide) in, but now I want to slide in t1-->t4 at _x = 200 and t6-->t9 at _x=400, how can i do this within this function/code?
Code: mc = ["t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"]; var i = 0; while (i < mc.length)
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:
In the FLA file i have two animations of a turbine and a fan turning one is controlled via a button the other is a loop action that is not controlled.The button control is simple telling the movie clips to got frame 2 and play,and on the fan and turbine movie clips I have a goto and play frame 2 action the end of their time line. By doing this I get a rotation effect .
The problem is that when I call play function from the start button the movie clip does not play properly and just shudders between frames,rather than way it should run as a looped animation.
I have a main timeline and on frame 6 I have a game1_mc to be controlled from the main timeline, that has start drag on it. The cursor changes to a hand but the movieClip won't drag. Could someone tell me how to get this to work? After trying many things, I currently have on a frame on the main timeline:
I need to write a function which should fix the location of the movie clip on the stage.
public function setCoOrdinates(xpos:Number,ypos:Number,movieName:S tring):Void { eval(movieName)._x=xpos; eval(movieName)._y=ypos; }
My function is as above. While I use this function in flash I only see the last movieclip on the stage which was passed. Movieclips passed earlier seem to have disappeared from the screen.
i have two MC with two swf files loading into them on my main file. what i am trying to do is have buttons in one MC move something in the my 2nd mc. i know that the _root. will work for controlling my main file but I'm don't know how to go about controlling anything inside of other movie clips.
I have a site I am working on which has a Flash intro. The other pages of the site hold a menu that's created in Flash. For some reason my client wants the ability to go back and view the intro again, which is easily accomplished with navigateToURL. HOWEVER the intro is broken into two distinct parts and I need to target the second part, which would require something along the lines of gotoAndPlay(500); or something to that effect.
What I am having problems with is how do I target a specific frame in a completely different movie, the intro, using a button from the Flash menu within the site. I'll try to explain it a bit easier. The top button on staticMenu.swf, which is placed throughout the site (aboutus.aspx, portfolio.aspx, etc...) needs to target frame 500 of mainIntro.swf which is embedded in default.aspx.
I'm mostly a point-and-click user of flash. I'm in CS5 and have built a simple flash website (with A/S1-2) having a primary swf (content.swf) and other transparent swf (home.swf, contact.swf, etc.) that load in for each menu button. When another menu button is clicked, my A/S instructs to unload all mc's from level 1 and load in the next swf in that same level.My challenge. I need to have a button in "home.swf" go to, say, "contact.swf". How can this be done?
I have to control one swf file with anoter. The situation is as it follows: there are two swf files in my HTML page. One of them contains a movie clip, and the other - buttons, which must control the first one - for example play this movie clip, go to a frame in this movie clip and so on. Is this possible? Maybe there is a way to connect both swf files with AS and after that use the inner instance names.
I have 2 swf's on one HTML page in 2 sperate cells of a table. Each one is a file-o-fax style tab menu. I want to be able to make the tabs in the unselected swf retract to their original position, when using the other swf.
Is there a tut kirupa or other on controlling one swf from another.so clsic example having a loaded playback bar then loading vid or mucis and the universal playback bar can control it.Could this be done either way of loading swfs (Into a movie on the main swf or loaded by levels?)
I've got two Movie Clips "MC1" & "MC2" on my main timeline with buttons that give them life so if i click on "MC1" then it plays the open and stops on the "up" frame the next frame in the movie is the "out" which plays the Movie Clip out. but when "MC1" is up and you click on "MC2" i want "MC1" to play the out frame. I'm guessing at this but is this anywhere close?his is the code attached to the button inside of "MC2"
I have a external .flv movie, that loads as a full screen background movie on the main stage. Using the Netstream class and the instance name of 'netStream' I just want to be able to pause/play this movie when the user click on a button. The button is inside a movieclip.
I thought something like this:
on (press) { netStream.pause("http://www.website.com/background.flv"); }
I'm attempting to create a website that uses externally loaded swf files into a shell animation like in Creating A Full Flash Site, only I'm trying to give each swf its own website url (ie. site.com/home, site.com/page2) while still using a single shell animation.
I have three buttons I have built as MC's. In each on the MC's timeline I have another MC's with instance name voted01_mc, votecd02_mc, and voted03_mc, respectively. And each of the MC Buttons have instance names Q01_btn, Q02_btn and Q03_btn.
I would like to find a way to control the "visibility" of a movie clip inside one movie clip from inside another MC. I am sure there is a way to do this such as:
i am trying to control 30 instances of a movie clip dynamically. the instances are as follows
ship1 ship2 ship3
[code]....
coming from php i would just set up an associative array like list array('speed'=>array(false,false,true,...),'weapon '=>array(true,false,....and so on I can not for the life of me figure out how to store this information and then use it as a variable name later.my end result should look something like this .. i just don't understand how to do this in as3 .. it seems unnecessarily convoluted.
Code:
foreach($upgrades['speed'] as $key => $val) { UpgradeScreen.'speed'.$key.visible = $val); this would dynamically call
[code]....
i know the above is incorrect.I want to create this so that it is completely dynamic and the instance names can be feed in dynamically as the array or whatever is being looped.
I was wondering if I could assign seperate buttons to play, rewind, stop or pause an FLV in my timeline from a seperate area of the page like a remote control as opposed to using a skin in which the buttons would have to sit under the flv. Do I have to use an events listener? Does anybody have an example of the action script I could use. I am using version 2.0 PS. The flv is a progressive download.
I have a small website and on one of the pages I have a progressive video inside an flv component. However, when I go to a new page the video plays in the background and if I hit the play button twice, the video 'double plays'. Is there a way to control and flv component with actionscript 3? I tried using the stop(); command within the function that selects the pages but I get an error message:
Well, I have a project where I would need a XML with a % range from 0-100 to controll a timeline. The concept is to fill a bottle. So the timeline would animate from empty to full. But must be controlled with a XML number and its all in AS2...
I have a SWF embedded in an HTML web page and want to move to a specific frame when a trigger is clicked. But nothing happens when I click the trigger, as though the js just doesnt communicate at all with the swf.SWF is written in flash cs4 (a3)The link to the website is [URL]..I have read the text books over and over and researched high and wide on the internet and as far as I see I have done everything correctly but I cannot get this to work. The swf is very basic, just a green box moving accross a small stage. The desired gotoframe would make it cross at a lower height (just a dry run for a more complicated swf)
I am embedding a swf built in flash 8 into an as3 project. When I call stop() or gotoAndStop(0); on the MovieClip that represents an instance of the embedded swf it stops for a sec and then continues. Trying to call removeChild on the mc removes it from the display but the audio in the swf keeps playing. The swf, in this case must be embedded, I cannot use loader.[code]
I am working on a project that needs to have the swf controlled by an external javascript file, I'm looking for something very simple like basically telling the swf what frame to go to in the main timeline. I know it's possible because I did it 4 years ago, the problem is that project and computer are long gone.
I've loaded my external SWF, now I want to animate a MC within that external swf, however, when i try, the animation freezes (or won't start at all), but the external SWF DOES load.Here is my loader code
Code: var _externalMovie:MovieClip var _url1:URLRequest = new URLRequest("intro.swf")
So I have a movie clip that will be composed of a few photos (one on each frame). And under that movie clip on the stage I will have arrow buttons. When a user clicks on the arrow button I would like the next frame) to show up. How can I point my actionscript3 to the movie clip to control the timeline in the MC file?
I never seem to get any answers on these forums lately but surely someone can answer this. I've loaded an AS2 based SWF in to an AS3 SWF. I want to gotoAndPlay a frame in the AS2 SWF when a button is clicked thats inside the AS3 SWF.