ActionScript 3.0 :: Controlling Movieclip From Main Timeline & Child?

Sep 26, 2010

This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.

import flash.events.MouseEvent;
stop();
mc_textbox.visible = false;

[code].....

View 12 Replies


Similar Posts:


ActionScript 2.0 :: Controlling Movieclip From The Main Timeline?

Jun 26, 2008

this ex. .fla controls the mc from itself but i would like to control it from the main timeline, ive tried a number of things but cant seam to get it to workthe .fla is here.and the code is here if you dont dl the .fla:

Code:
onClipEvent (load)
{

[code]........

View 5 Replies

Actionscript 3.0 :: Controlling Main Timeline From A Loaded MovieClip?

Mar 17, 2009

I am building a website in as3. As of now this is what I have. My main file has a button on it and builds a movieclip to hold loaded movieclips.

The file runs and loads about.swf into the main file. When the button is pressed it tells about.swf to play the exit animation.

All of that is working. What I want to happen now is once the exit animation finishes I want the about.swf file to tell the main timeline to load a new movie.

I can control loaded movieclips from the main timeline I just do not know how to control the main timeline from loaded movieclips.

View 5 Replies

ActionScript 3.0 :: Remove A Child From The Main Timeline From Within A Movieclip

Feb 3, 2010

Someone the other day provided me with this code to a remove a child from the main timeline from within a movieclip.

parent.removeChild(MovieClip(parent).mc1);

This works fine, but how can I write an if statement to test if its in the display list before removing it?

As I'm getting an error if I try to remove it once its already been removed.

View 4 Replies

ActionScript 2.0 :: External SWF - Controlling Main Timeline

Mar 21, 2009

I'm having a bit of time getting this to work.
Setup like this: Main mov:
Nav1 is clicked and loads in external swf. In the swf that was just loaded there is button to call another external swf on the main movie's timeline. I'm trying make a "lightbox" effect. Where you click on the external swf and the screen darkens and a swf is loaded on top of it. Above the loaded swf. Of course on a new layer.

PHP Code:
This is handling the swfs that get loaded in
EXTERNAL SWF LOADER
_root.page_mc.preloader_mc._visible = false;
_root.page_mc.preloaderText_txt._visible = false;
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);
[Code] .....

View 9 Replies

ActionScript 3.0 :: Controlling Main Timeline From Loaded SWF

Nov 2, 2010

I have a simple swf called site.swf that loads a menu with UILoader called menu.swf, from menu I'm able to navigateToURL but I also need that it goes to frame 50 in menu.swf.

View 1 Replies

ActionScript 2.0 :: Controlling Main Timeline From Dynamic .swf?

Aug 12, 2008

I have a main.swf which plays, then stops, loads a dynamic .swf... And what I want is, from either the dynamic .swf or the main one, when the dynamic .swf is finished, the main .swf will continue/play.

View 1 Replies

ActionScript 3.0 :: Controlling Main Timeline From Loaded Swf?

Feb 22, 2011

So basically I have two swfs, main.swf and level.swf.. main.swf simply has two frames, first one has the code below to load level.swf and the second frame has some text in it, it's labelled "theend".

Code:
var request:URLRequest = new URLRequest("level.swf");
var loader:Loader = new Loader()
loader.load(request);
addChild(loader);

level.swf is more complicated, it's a little game and blah blah, but the thing is that I have a button (cnt_btn) in the last frame. I'd like this button to go to the second frame ("theend") of the main timeline.

View 2 Replies

ActionScript 3.0 :: Controlling Main Timeline In A Movie Clip?

Nov 5, 2010

How would one on a specific frame inside a movie clip cause the main timeline to go to a certain frame label?

I know how to use gotoandstop(), but i can't seem to find a working, correct syntax variable that accesses the main timeline and not the movie clip's timeline.

View 3 Replies

Movie Clip Button Controlling Main Timeline?

Jan 4, 2012

I'm in the process of designing this site as a portfolio for my art and am in the process of creating and laying out the galleries. My idea was to create movie clip animated buttons that would react to the roll over stuff. I got that part to work the way I wanted it. But now, I can't seem to figure out how to put a "Gotoandplay" type of code on the buttons so that the timeline would jump to the appropriate frame and play. (I put an "on(release) gotoandplay" on it the way I would put it on a button but it never responds. I have a couple of buttons that work fine with a "geturl". so I thought a "gotoandplay" would work fine. If this can be figured out in a way that I can easily use it for all buttons with just the frame number needing alteration, that would be best. After you click the splashpage door jpg, there will be a piece of paper on the floor. That is a button which should trigger the animation that starts at frame 114. When clicked, the page lifts up and spread open to two pages. But it never reacts

[URL]

View 6 Replies

ActionScript 3.0 :: Controlling Main Timeline With Nested Button

Jul 12, 2010

i've made a drop down menu that works fine as it goes for dropping down when moused over the button which triggers is menu. but when im trying to add functionality which is triggered by the nested buttons that drop down i cant control the frame position of the main timeline does anyone know how i can do this.

View 1 Replies

ActionScript 2.0 :: Buttons In Movie Clips Controlling Main Timeline?

Aug 5, 2004

Ive been having problems getting buttons within a movie clip to control the main timeline and switch scenes. Ive tried everything from _root.gotoAndPlay to with(_parent) and such.

View 1 Replies

ActionScript 2.0 :: Controlling Multiple Movie Clips With 1 Set Of Code On The Main Timeline?

Jul 19, 2011

So I have been trying to figure out a way to control multiple clips using the same "on press" & "on release" statements located on 1st frame of main timeline. A variable is being set to a value that correlates to the name of each movie clip as an interaction occurs.Ex: user clicks from a selection of buttons & depending on the button clicked it sets clipNum = "1" through "21".What I want is to have something like the following code that will give the user the ability to click and drag the clip with code on the main timeline similar to the following:

_root["drag_" + clipNum].onPress = function () {
startDrag (_root["drag_" + clipNum]);
};

[code].....

View 2 Replies

Professional :: Button Inside A Movie Clip Controlling Main Timeline?

Mar 10, 2010

I have a movie clip on the main stage- inside that movie clip is a button- I want that button to contol a function on the main timeline-

example: Button Script

closeAll_btn.addEventListener(MouseEvent.MOUSE_DOWN, goCloseAll);
 
function goCloseAll(e:MouseEvent):void {
****don't know what to put here to activate "closeAllOpenMovieClips" function on main stage****
}
 
example: Main Stage Timeline Script
 
function closeAllOpenMovieClips():void {  trek_mc.gotoAndStop(1); lost_arts_mc.gotoAndStop(1);  rain_mc.gotoAndStop(1);  vintage_mc.gotoAndStop(1);}

***don't know if I need more script on Main Stage Timeline that just "function" ***

View 5 Replies

ActionScript 3.0 :: Adding Child And Stopping Main Timeline?

Sep 3, 2010

So I am loading in external swfs and once loaded in I want to stop the main timeline. so I do the following.

var swf : MovieClip = e.target.content ;
swf.stop();

which doesn't work, because I have trace statements in the external swf which fire off after that command is called. Which, here is another weird thing, When I trace through the loaded swf, it says it has two children, a shape, and a Loader. The shape is weird because what I have is another movieclip on stage so I should get instaceXX, and I dont know where that Loader class is coming from.

which also brings me to another question which is everytime I add the swf to the stage it duplicates the instance, and I run out of memory really fast after I keep removing and re-adding it. all I call is.

targetMC.addChild(swf);

then after the swf dispatches an event saying its done.

targetMC.removeChild(swf);

View 1 Replies

ActionScript 2.0 :: [Flash8] Assign A Variable To The Current Frame Of The Main Timeline (not Movieclip Timeline)?

Mar 16, 2007

I 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 Replies

Professional :: Moving To A Frame In Movieclip Timeline From The Main Timeline

Apr 26, 2011

I 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]...

View 1 Replies

IDE :: Child Movieclip Timeline Changes Don't Show In Parent Timeline?

May 21, 2009

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 Replies

ActionScript 3.0 :: Can't Access Variables That I Declare In Main Timeline From A Child

Sep 14, 2009

I can't access the variables that I declare in the main timeline from a child.

I attach the child to the stage during runtime.

View 3 Replies

Flash8 :: Controlling Timeline From A Movieclip?

Sep 1, 2010

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].....

View 1 Replies

ActionScript 3.0 :: Controlling A Movieclip Timeline

Sep 3, 2011

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 Replies

ActionScript 3.0 :: Controlling Labelled MovieClip On Stage From A Child .as File

Jun 20, 2009

I have an FLA file with a movieclip on the stage which is labelled "blok", and a button on the stage labelled "button1". This FLA is attached to a file called main.as through the document class.

In the same folder where I am storing main.as I have a second .as file called secondFile.as. I have imported this class into main.as using: import com.tests.secondFile;

and in the constructor of main.as I have put:

loadB=new secondFile(button1);
addChild(loadB);

Within secondFile.as my constructor looks like this:

public function secondFile(button1:SimpleButton){
button1=button1;
button1.addEventListener(MouseEvent.MOUSE_DOWN, buttonPushed);
}

[Code]....

Basically I'm trying to get the MovieClip labelled "blok" to move by 50 pixels on the stage when button1 is pressed, but when I test my FLA I get the following error:

1119: Access of possibly undefined property blok through a reference with static type flash.displayisplayObjectContainer.

I would have thought that this.parent.blok would control my movieclip labelled blok on the stage of my FLA from within secondFile.as since secondFile.as is a child of main.as which is the document class of my FLA, but obviously this is not right.

how to access labelled items on the stage from within a child object.

View 6 Replies

ActionScript 3.0 :: Controlling Timeline Of Parent Movieclip?

Jan 14, 2009

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.

View 8 Replies

ActionScript 2.0 :: Controlling MovieClip On Root Timeline?

Aug 19, 2008

My stage is empty except for an MC with a simple animation and an AS 2 layer. There is not a button or user interaction that engages the MC. I want the MC to play when the timeline reaches the frame with the AS. My MC has an instance name of 'blueMC' and here's the AS I've tried:

blueMC.play();
_root.blueMC.gotoAndPlay("2");
on(load){
blueMC.play();
} onClipEvent(load) {
blueMC.gotoAndPlay("2");
}
Shouldn't it just be this?:
MCinstanceNmae.gotoAndPlay("Frame# or label");

View 1 Replies

ActionScript 2.0 :: Controlling A Movieclip's Internal Timeline W/ X+y?

May 21, 2010

Im really struggling with controlling a movieclip (frame-by-frame images w/ stop(); actions) by using the mouses horizontal position on the main stage. So basically I want to turn my stage into a showreel of images. Lets say the stage is 50 pixels; i would want some kind of code that would divide up the total length of my m/cs timeline, in order to show the first frame of the m/c when the y-axis is at 0, the last keyframe of the m/c when the y-axis = 500.

I have tried to use rollover commands on (miniscule) hit states covering the entire stage, but there must be a better way ( i plan on updating the images m/c a lot) ie. a lovely big chunk of confusing code?

View 2 Replies

CS3 Controlling Timeline Backward And Forward Inside Movieclip?

Aug 12, 2009

Im trying to produce my online portfolio but for that i need to play movieclips backward and forward to various frame numbers.I found a very good script (as2) and it works great in the main timeline but inside a mc it doesnt work at all. this is the script

1. Call to Action Create an actionscript layer that extends the full length of your movie. In that layer, include the following actionscript:

function Movement() {
if (_root._currentframe > _root.mytarget){
prevFrame();

[code]....

Using the code above, the movie will play either backwards or forwards to the desired destination.As i said before this script is great but it doesnt work inside an mc.

View 3 Replies

CS3 : Controlling Timeline Backward And Forward Inside Movieclip?

Dec 6, 2009

Im trying to produce my online portfolio but for that i need to play movieclips backward and forward to various frame numbers.I found a very good script (as2) and it works great in the main timeline but inside a mc it doesnt work at all.this is the script

1. Call to Action Create an actionscript layer that extends the full length of your movie. In that layer, include the following actionscript:

function Movement() {
if (_root._currentframe > _root.mytarget){
prevFrame();

[code]....

Using the code above, the movie will play either backwards or forwards to the desired destination.As i said before this script is great but it doesnt work inside an mc.

View 1 Replies

AS3 :: Buttons Controlling Timeline Not Working Inside MovieClip?

Feb 25, 2011

This is my first time coding a website using ActionScript. So far everything has went very well, I designed the website in Photoshop, and imported to Flash CS5. Then I cleaned everything up, and started adding navigation to the various pages using buttons.The website is constructed in a very simple manner, there are five main pages and they are connected by buttons on a static navigation bar (the first page, home, doesn't have a corresponding button). Then there are nine sub pages, that each contain information on a character of the game, and are connected to corresponding buttons in the 'Character' layer/MovieClip. My four menu buttons (Story, The World, Characters, Extras) all navigate correctly without problems.

The problem arises because inside my Characters page (a movie clip) are nine buttons, each linking to a different page. These buttons should bring the timeline to the frame specified, but when the buttons are clicked nothing happens. I've spent hours searching for a solution to this, but with no avail, and I have a feeling the answer is prettysimple.gotoAndStop("gowang", "Scene 1");line in the Gowang character button function with:MovieClip(root).gotoAndStop("gowang");

View 3 Replies

ActionScript 2.0 :: [CS3] : Getting GotoAndStop From Main Timeline To Movieclip Within Movieclip?

Nov 20, 2008

I 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.

View 7 Replies

Actionscript 3 :: Access A Movieclip On The Main Timeline From Within A Movieclip?

Mar 6, 2012

Working 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;
}

View 1 Replies







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