ActionScript 3.0 :: Commanding Timeline Or MovieClip
Jul 23, 2009Is it possible to command a timeline or MovieClip from an external swf? Main.swf calls in External.swf - How would I control a movie clip in main.swf from External.swf?
View 0 RepliesIs it possible to command a timeline or MovieClip from an external swf? Main.swf calls in External.swf - How would I control a movie clip in main.swf from External.swf?
View 0 RepliesI want to disable 6 movie clips after an onRelease function ..Rather than writing:
myMC.onRelease = function (){
thisMC._alpha =50;
myOther1_mc.enabled = false;
[code].....
I want to disable 6 movie clips after an onRelease function ..Rather than writing:
myMC.onRelease = function (){
thisMC._alpha =50;
myOther1_mc.enabled = false;
myOther2_mc.enabled = false;
[code]....
How could I sum up all those myOther*_mc's as one term, so that I can call 'group_mc.enabled = false;' instead, and have it in one nice line. ... ?
I've a button in MC1 (MC1 is resting in root) and I want it to take another MC2 (also resting in root) to go to a certain frame.. the instance name for MC1 is 'blah1'
How'll i make the button in MC2 to take MC1 to lets say frame#10.. ?
I've a button in MC1 (MC1 is resting in root) and I want it to take another MC2 (also resting in root) to go to a certain frame.Supposing, the instance name for MC1 is 'blah1'.How'll i make the button in MC2 to take MC1 to lets say frame#10.. ?
View 4 RepliesI simply want to assign a variable to the current frame of the main timeline (not movieclip timeline) I already know about _currentframe and it doesn't help in this case.
View 4 RepliesI am in the learning process. Working with FlashCS5 and AS3. if the issue appears to be too simple for you. Placed a movieclip(mcassessJohn) on the main timeline and moved to the frame labelled "johnFeedback" in the movieclip timeline using the following actionscript code.
[Code]...
Why does a child movieclip only show the first frame within the IDE, regardless of where you are in the parent timeline?If you throw a movieclip with 25 frames onto the main timeline, which also has 25 frame, you don't see the nested movieclip's frame-progress while you scroll through the main timeline.Is there a setting somewhere in preferences or somewhere that will enable you to see a nested movieclip's frame position from the main timeline? Like you do with After Effects composites?
View 3 RepliesHow do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have
addChild(fade_eng);
and in fade_eng I have the following on frame 20
root.gotoAndStop(2);
this.gotoAndStop(1);
But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.
I have a button inside a movieclip, to which I would like to apply a rollover function. When rolled over, this button (inside MOVIECLIP 1) would make (MOVIECLIP 2) jump to second frame. I'm using Flash 8.This is turning onto a real headache for me, since i've searched every single forum and thread concerning this matter, and nothing seems to work.
View 7 RepliesI have a main timeline with a button. I need the action for this button to gotoAndStop to a frame within a movieclip, within another movieclip. I have tried on the main timeline setting the actions of the button to:
on (release){
clip1.clip2.gotoAndStop("frame1");
}
and tried:
on (release){
_root.clip1.clip2.gotoAndStop("frame1");
}
lastly:
on (release){
_parent.clip1.clip2.gotoAndStop("frame1");
}
If I double-click on the movie clip (clip1) and then double-click on the movie clip (clip2), I have several frames labeled "frame1", "frame2", etc.The button doesn't work.
Using a movieclip rollover to change another movieclip timeline?
View 1 RepliesWorking on an RPG type flash, and I have to be able to control a text-box from quite a few locations. The one that is causing me trouble is the inventory. I need to be able to access the textbox with an instance of "statusWindow" from within the inventory clip (instance name "inventory"), so when I mouse over an item within the movieclip it will change the status window on the stage.In this instance I want to mouse over inventory.invHealth from the main timeline to get the display.itemName and itemProps are strings containing information about the item.I tried the following but it gave me a "possibly undefined" error.
invHealth.addEventListener(MouseEvent.MOUSE_OVER, itemStats);
function itemStats(e:Event):void
{
root.statusWindow.text = itemName+"
"+itemProps;
}
I am working on a project where the document class needs a timeline with at least 2 frames. This isn't that hard right? Create a fla, give it the frames I need and set the document class.But I can't/won't/don't-want to do that. (I'm using FlashDevelop and ANT. Screw the IDE... le sigh)I was hoping that I could create a swc that contained a MovieClip asset with the correct number of frames in it.Then I could have my main class extend that swc asset, and thus acquire the frames it had. But this isn't working Does anyone have any idea how I can use a swc asset to gain its timeline for the document class of a swf?Things I have tried:
Actionscript Code:
//SWC:TwoFrameMovieClip extends MovieClip // (has 2 frames in it)package { class Main extends TwoFrameMovieClip { public function Main () {
[code]....
So im creating a site for a friend and I have placed the menu inside a movieclip so the buttons are inside the movieclip. This the script i have tried :
Code:
stop();
natural1.onRelease = function () {
[code].....
so I have a school assignment to make a banner, but I need to add a movieclip to it since its just keyframed text now basically.I have made my movieclip, its a countdown timer from 26seconds to 0, it works fine to play it etc.But when I try to drag my movieclip from the library into the timeline, it just gives me and error sign on the mousecursor. If I drag it into the workingspace scene where the rest of my things are it will show up but it wont start the keyframed countdown.
View 1 RepliesHow can I reference a MovieClip within that same MovieClip's timeline. (I want to reference itself). Inside the MoviClip on the first frame I have this:
this.alpha = 0;
I want the MovieClip to have an alpha of 0 but it is still set at 1.
I know it's not good form to place code on the timeline in as3 since its all coded from classes and the document main class, but isnt it easier to have something like...
Code:
removeChild(this); At the end of the timeline inside a movieclip... Instead of having to do something like this:
[Code]...
Btw: would the first line of code I typed work? I haven't tried it.
I have buttons that load movie clips when you mouse over them and unload the movie clips when you mouse out.[code]the problem is that the movie clips aren't necessarily playing from the beginning when you mouse over, since their timeline is independent.How can i specify that I want to add the instance of the movie clip to play from frame 1.I've tried using the gotoAndPlay method with the frame number/ label in parenthesis afterwards and got an error message..I've looked through multiple tutorials on controlling symbols using AS, and i still can't get this to 'click' for me.[code]
View 3 RepliesI want to embed all the content of my flash project in a movieClip.
View 3 Replieswhat i'm trying to accomplish is onthe rollover of a button, a picturefades in, and on rollout, the picturefades out. that shouldn't be too hard,but i would like to have one rolled out and another rolled over, so one pictureis fading out, and another fading inthese pictures are supposed to overlayso i am thinking that i will need to useactionscripts to control the timeline ofa movieclip.
View 1 RepliesHow to access the timeline of a movieclip from inside ANOTHER movieclip (both MCs are placed on the root timeline BUT in different frames) (if not possible, AS3 instead?)
View 3 RepliesWhat I'm trying to do is very very basic however its flat out not working. I'm trying to add a event listener to a button located within a movieclip thats on the root time line.Here's the code:
Code:
function main_init():void
{
[code].....
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 RepliesI do have a movie clip and inside that movie clip I have used a button in order to control the time line of the MC. I have divided the MC time line in to 4 parts. and according to the roll ove and role out the movie clip works. I want to change the scene when user click the MC clip. How can i do that? I have attached the FLA file to this one.
View 1 RepliesI have a movielclip, nav_mc, inside which contains my navigation buttons. Lets say I want to effect the time timeline. Before in AS 2.0 I could simply go
jan1_mc.onRelease = function() {
_root.january_mc.gotoAndStop(2);
}
Now in AS 3.0, nothing works.
button_mc.addEventListener(MouseEvent.MOUSE_UP, doIt);
function doIt(evt:MouseEvent):void {
_root.january.gotoAndStop(2);
}
That doesn't work. Returns this in errors:
Warning: 1058: Migration issue: The property _root is no longer supported. This property has been removed. The closest equivalent is the Stage, which serves as the root of the ActionScript 3.0 display list..
Neither does
root.january.gotoAndStop(2)
or
stage.january.gotoAndStop(2)
(1119: Access of possibly undefined property ball_mc through a reference with static type flash.display:Stage.)
or
_stage.january.gotoAndStop(2)
or anything!
How do we do this very simple thing now in AS 3.0
TLDR;
How do I reference the _root timeline in AS 3.0 since _root. no longer works in 3.0
I have a MovieClip with several labeled animations on it's timeline. When I made the MovieClip I leaved extra frames between each labeled animation, to see things better and to better read the labels. Everything worked just fine, but then I needed to dispatch an event when each labeled section of the animation was done, so I trimmed out the extra frames (which were completely empty... no code, no drawings, nothing) and placed a dispatchEvent(); and a stop(); function on the last frame of each labeled section of the animation...
And this is when my problem occurred: the animation stops at a specific frame within each animation each time I play it. There is no code on that frame, the symbol doesn't run out of frames, or whatnot. I have cancelled all the code that I could to simplify things, and it still doesn't work. I tried adding back the extra frames, cutting out the action frames(so sort of undoing manually to the point that it last worked), but it still stops in the middle of each animation... If I could roll back to before this happened I would try not cutting out the extra frames and just placing the action frame where the animation ends, but I can't...
I've just swiched over from FL8 to FL CS4 (3 days ago). I'm learning AS3 at the moment but am on a deadline with a project (a bit over it actualy) which uses AS3
I have a movieclip (container_mc) on the main timeline which holds all the animation and a timer (timer1_mc).When container_mc reaches frame 2 it stops and a timer (timer1_mc) starts running.When the timer finishes, container_mc should continue to the next frame.The code I have to do that (from the timer1_mc) is:
if (d> 260) {
parent.container_mc.nextFrame();
trace("blabla");[code]....
This doesn't work, it gives me the error 1119: Access of possibly undefined property container_mc through a reference with static type flash.display:DisplayObjectContainer.
i use MovieClip(this.parent) to access a variable that's outside of the movieclip i'm currently writing code in. However, this doesn't work within two functions.For example:
function editMainText (e:Event) {
MovieClip(this.parent).headline.text = "Hello"[code]....
doesn't work.There are probably a few small errors in my code, but i essentially need to know how to modify MovieClip(this.parent) to work within the second function.
I asked some flashers to take a look at my problem, but they did not know what happed or why it happend.If you apply a color to a movieclip within a timeline, you also destroy the animation so it seems.I enclosed the fla file for test purpuse. But what i am doing is:I have a main clip called animation and in this clip the playhead goes from frame 1 to 30Inside this animationclip i have a square called myclip that also does some animation.But when you apply a color to this square and you run the animationclip, you will notice thatthe square does not animate anymore. But the playhead still runs, so that is weird isn't itDoes anyone know the answer to this bug ?
The code i used is:
function applyColor(mc:MovieClip, col:Number) {
var tempColor:Color = new Color(mc);
[code]......