ActionScript 3.0 :: Controlling Object In Another Movie
Mar 6, 2009
I'm pretty sure this is possible, but I can't get it to work. I have a main movie and in one frame I am loading in another swf. The user goes through the activity in the loaded swf and then needs to continue on in the main movie. I've added code in the last scene of the loaded swf that I thought would allow it to navigate to the next frame in the main movie:
PHP Code:
function next4(evt:MouseEvent):void {
this.parent.parent.gotoAndStop(4);
} continue2_btn.addEventListener(MouseEvent.CLICK, next4);
But when I play the main movie, I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ELC_fla::MainTimeline/frame3()
I have tried to communicate to the continue button in the loaded swf from the main movie, but that didn't work either.
View 7 Replies
Similar Posts:
Apr 28, 2003
say i have a main movie, into this movie is loaded another movie on level_1.
is there any actionscript that allows a button inside the loaded movie control the main movie? i.o.w. can a button inside the loaded movie tell the main movie to go to another scene?
+ i am looking for code for that same button to unload the movie it is in itself..
View 10 Replies
Jun 16, 2005
I have instances in my movie layed out as such
_root contains
[sliderX] which contains
[holder]
Where X is a number from 1-500 inside [holder] is a button that when pressed should load an image into new browser (does this fine) then move the main movie to it's next scene. this is when it fails. I have tried
[Code]...
View 1 Replies
Jan 9, 2011
i have two movieclips on stage, one load as a class an mc with animation, the other load a button...how can i send the message, comunicate both clases to let the button start the animation?
View 4 Replies
Jan 24, 2010
If I import pgming from one AS into an overall one like this:
import asFiles.slideshow.*;
public var slideshowAS:Slideshow;
//then later:
[code]...
how do I control one object that is within that child .as file from the parent .as file?so for instance if in the slideshowAS there is an item called "nextBtn" and I want to be able to do something with it in the parent main menu .as file.
View 15 Replies
Feb 1, 2012
I'm rendering a xps file using flash (no MX or Spark), and I'm running into a sort of 'contradiction' that I'm unable to solve. [Note, that I'm trying to work only in core flash (e.g. Sprite, Shape, etc.), I've already solved (sort of) this issue using Spark.]
The pages of the xps file specify an explicit size. However, the content described (especially paths) in the xps file can sometimes extend outside of this area.
The problem is, I want the parent Sprite to have the size specified by the xps file, for example so scroll bars match the page size (not the sprite size), but in some cases the Sprite is much larger than this.
I've tried recursively going down and scaling everything UP, and then at the end scaling the parent container DOWN. Unfortunately, this causes translation problems with paths, and I assume it can also cause problems with bitmaps, etc.
Without using MX or Spark, is there anything I can do to control the size of the parent Sprite, other than scaling all the children independently?
View 1 Replies
Sep 14, 2011
I recently bought an mp3-player coded in Flash and it works great, except for the fact that I do not want it to appear constantly on the timeline.
The mp3-player is generated throught code, so I was wondering if there is a way to control the alpha of a variable named mp3playerContainer and set it to 0? I have navigation points on frame 25 and 55 where I want this mp3player to not be visible. Could it be an idea to use "currentFrame", so that if currentFrame equals 25 or 55, then alpha of the variable mp3playercontainer will be set to 0?
View 2 Replies
Jan 24, 2010
If I import pgming from one AS into an overall one like this:
[Code]...
how do I control one object that is within that child .as file from the parent .as file? so for instance if in the slideshowAS there is an item called "nextBtn" and I want to be able to do something with it in the parent main menu .as file. If you could even direct me on what to search under I that would be very helpful! I tried googling it but did not know how to search for it.
View 2 Replies
May 7, 2011
Here's my problem. I have a movie on a stage (MyMovie) that I can control with start and stop buttons. Let's call it MyMovie. Inside that movie there are 4 layers. Layer one has movie1 which contains a movie created with a movie clip symbol that has been tweened over 60 frames. Layer 2 has a movie clip which has the movement generated by action script using a simple aray. That movie has start and stop buttons controlling the action script movie. Layer 3 has a movie clip (movie3) that is generated using the built feature copy motion as actionscript 3.
I know it's kind of confusing so here's a screenshot of the MyMovie timeline:
Here is the Scene timeline:
The problem I'm running into seems like it should have a simple solution. The first line in the Actionscript for Scene 1 is stop(). I expect MyMovie not to play. The blue outline around the yellow circle is actually a blue circle below the yellow circle. It is the only component of MyMovie that derives it's animation from a tween. It is also the only part of the animation that is stopped. The yellow circle, motion by a tweening a simple array will play with the stop and go buttons and the orange circle animates all the time. Pressing the big go button causes the blue circle to animate, pressing the stop button causes the blue circle to stop, but all the other animations inside MyMovie keep running. I have no control over the embedded movies.
I seems to me that it should be easy to start and stop all elements embedded inside MyMovie by simply stopping MyMovie. There's obviously something that I'm missing here.
View 3 Replies
Dec 5, 2010
i want to run movie with more controlling If I have a time line displaying some motions Every motion have a number
Is it possible that the user of swf flash select the number of motions he want to run by input the beginning motion number and the end motion number ?
And can he choose a number to repeat that motion he have chosen ?
it is working very well as it is but when i manipulate it and the time line enlarged .. it doesn't work
View 2 Replies
Feb 21, 2003
I'm having a 2 flash movies in my web page (let's say index.html , movie01.swf and movie02.swf). Is there a way, when something happens on movie01 (like a click) that movie02 does something as well like plays a MC? My HTML page has 3 frames, 1 top, 1 left, 1 main. Movie01 on top and Movie02 just a small area in left frame.
View 8 Replies
May 19, 2009
Im working on a quiz kind of game in which if you click an object, you get a question (the object is a movie clip and the question is within it). If you answer it, the movie clip stops at a particular frame. And so go all the objects in the game. Now, because you cant predict which object the user will click on last, I dont know how to bring in an ending screen saying that they've completed it successfully.
View 1 Replies
Mar 22, 2010
Problem:I have my main Scene 1.In that scene I have 2 layers.Layer 1 has a movie clip named ca.Layer 2 has a movie clip named tutorial.When a button is clicked in movie clip ca I want it to tell movie clip tutorial to gotoAndPlay("31")
I was using the code:
btn_ca.addEventListener(MouseEvent.CLICK,click01);
function click01(e:MouseEvent):void {
[code].....
View 4 Replies
Nov 4, 2010
I'm working from main.swf and I need to call another swf to display one of four flvs once the appropriate button is clicked.
main.swf = my main content
player.swf = contains mc_playMovie
mc_playMovie = embedded in player.swf and contains four frames, each with a different flv movie.
My code so far:
butDelmar_thumb.onRelease = function() {
createEmptyMovieClip("targetMC", this.getNextHighestDepth())
targetMC._x = 0
targetMC._y = 0
[Code].....
View 1 Replies
May 24, 2011
im trying to get a button to move a list of movie clips up and down how would u go about this
e.g
i have a button at the top of the stage and a button at the bottom and when the top one is clicked it moves up one movie clip till last one is hit. and if the bottom one is hit it moves down one until it hits the last one
View 3 Replies
Feb 21, 2010
I am making a game were you create movieclips with a button and move them around using a function system. The problem is, I want to control all of the same attached version of that movieclip in the code. how exactly would i do that if the instance name changes every time I load it?
View 3 Replies
Dec 8, 2010
I have spent 2 1/2 days now looking for a way to make a movie of 16 pictures where the progress of the movie can be controlled by a slider. This is either not a very common use of flash, or a very advanced project to take on. I know nothing of action script, and am trying to learn how to make this happen. I have been able to do this with buttons to go forward and back a frame when pushed, but I can't get the slider component to corelate with frames.
View 2 Replies
Sep 8, 2009
I have a portfolio page with several trailer thumbnails (a portfolio list). If you click on each, the page changes and you see the trailer in a video player, plus more info about the film. I used two frames in the timeline: the first frame has the clip with the thumbnails (port_list). The second frame has a movie clip container and the video player. The idea is that pressing the respective button from port_list will load the details of that movie and the movie into the video player. I am using this script:
ZSQ_but.onRelease = function (){
_parent.gotoAndStop("por_details");
myplayer.contentPath = "videos/ZSQ.flv";[codde]....
Even though the script looks alright (and works alright if at the root level), it will not work from the child clip. What am I doing wrong?
View 2 Replies
Jul 20, 2011
I'm at the end of my flash site creation and I would like to have the "mouse_down" keyframe in my movie clip to change the frame of my other movie clip displaying the content of the page. How would I go about a gotoAndStop() function to control a movie clip from another MC?[Code]...
View 1 Replies
Oct 26, 2011
I am loading a MC in frmae 3 of the main timeline. In the MC, there's a button which I would like when pressed to run the main movie at frame 2. Below is the code.[code]I cannot get the gotoAndPLay bit to work. I;ve tried sooo many combinations (parent, _parent, this._parent etc etc) but to no avail.
View 7 Replies
Feb 18, 2004
is there a way to refer to all movie clips on the stage or apply a function to all movie clips without applying the function to all manually?
View 3 Replies
Apr 18, 2004
The problem I have is when i select to move the movie clip, i can't get it to stop animating when i tell it to go to a certain place.
View 4 Replies
Oct 10, 2004
What is the best way or controlling one movieclip from anoither. Pretty much want my menu and contentas two separate files but of course i need to contol my content from the menu.
View 1 Replies
Aug 26, 2005
createEmptyMovieClip("_root.displayMV.portfolio", 1);
win.loadMovie("portfolio.swf");
That is a frame action - The "win" is my instance & the "portfolio.swf" is my external flash movie, I want this frame to tell my external flash "portfolio.swf" movie to go to and stop at frame 3 or 4, becuase at this time its only playing from the start.
View 5 Replies
Sep 10, 2008
I'm able to load the actual external SWF movie, but I can't seem to control it. I have already built a controller for my flash video player. The problem now is it only plays FLV and I want it to be able to take in SWF support. Again, I load the SWF fine, but controlling is the problem.
function finished_loading (e:Event) {
var externalMovie = MovieClip(swfLoader.content); // cast 'DisplayObject' to 'MovieClip'
addChild(externalMovie); // add your swf directly to the stage
[code]....
I think this is the problem with the code. Casting it to a MovieClip only gives me a 1034 error.
View 2 Replies
Jan 4, 2009
I'm able to load the actual external SWF movie, but I can't seem to control it. I have already built a controller for my flash video player. The problem now is it only plays FLV and I want it to be able to take in SWF support. Again, I load the SWF fine, but controlling is the problem.
function finished_loading (e:Event) {
var externalMovie = MovieClip(swfLoader.content); // cast 'DisplayObject' to 'MovieClip'
addChild(externalMovie); // add your swf directly to the stage
[code]....
View 1 Replies
Feb 27, 2009
I have a movie clip nested in frame 2 (* = movie clip in frame 2), it looks like this:
[1][2*][3]
When I test the movie it skips over frame 2. What type of action script (AS2) do I need either in the movie clip and/or in frame 2 to get the movie to play before proceeding and stopping at frame 3?
View 1 Replies
Sep 7, 2009
Basically what I'm trying to do is have one button move two objects, each at different speeds. My first object is called "bg" the second is called "test." I have two buttons, "left" and "right" and when they are clicked on, only the "test" object moves. Here's the code I'm using:
function onRollOver():Void {
if (bg._x<gLEFT) {
bg._x = gLEFT;
[code]...
View 3 Replies
Oct 12, 2009
so here is the thing: I have a movie clip with 12 frames (lets call him MC), each frame shows a symbol. I want to create a class that control the MC instances, (lets call that controlClass) the controlClass will have function to change the frames of the MC instance and some other stuff. last thing I tried is that you give the constructor of the controlClass the instance name of the MC and tried to do that for example: stage. + MCInstanceName + . gotoAndPlay(2); that's what I'm trying to accomplish, at least.
View 4 Replies
Feb 19, 2009
On my main timeline I have two movie clips sitting side by side in frame1. They are called content_mc and content_mc2. Those are their respective names in the library and as instances. Now, I have a button in content_mc in which I am looking for the following behavior. When I click it, I want the timeline inside
content_mc2 to jump to frame2. MovieClip(parent).gotoAndStop(2); This code would be just dandy if I wanted to go to frame 2 of the main timeline, but I cannot find, for the life of me, how to go up one level (parent) and then specify down a new level (content_mc2). In other words, where do I put "content_mc2" in this syntax?
View 1 Replies