ActionScript 3.0 :: Cant Control Movieclips?
Apr 3, 2011i have one mc (movieclip).mc has inside a mc1 movieclip. my question is
[Code]...
i have one mc (movieclip).mc has inside a mc1 movieclip. my question is
[Code]...
I used to work in AS2 and something like this worked:
mc1.mc2.onRelease = function () {
mc3.gotoAndStop(2);
}
But converting it to AS3, it doesn't work anymore.
function goMC (e:MouseEvent):void {
mc3.gotoAndStop(2);
}
mc1.mc2.addEventListener(MouseEvent.CLICK, goMC);
What am I doing wrong? I can't seem to control movieclips within movieclips.
For what ever reason I can't get an MovieClip that's on the main timeline to play from another MC.It appears that when targeting a MovieClip on the main timeline, root and parent don't seem to work in AS3. Or at least not in the same was as AS2.So inside a MovieClip called control_mc, I want to tell myStage_mc, located on the stage, to start playing when the play head reaches a certain frame inside control_mc.inside control_mc I've tried,
myStage_mc.play();
root.myStage_mc.play();
parent.myStage_mc.play();
myStage_mc.parent.play();
myStage_mc.root.play();
Flash complains, access of undefined property.
I'm new to flash, so I am sure I am missing something basic, but I have not been able to reference movie clips independently in code. I have set an instance name on each symbol, but when I reference in code it is undefined.
If it matters my project is set up this way:Using Flash 4 Pro. Layer one: Static Background Layers two-five: individual movie clips Layer six: transparent buttons over the movieclips.The buttons work fine, but I wanto to play the movieclips on mouse over.
Suppose I have movie clips named mc1,mc2,mc3,mc4... In as2[code]...
View 1 RepliesI built my website on the main timeline with a fade in animation...stop(on the page) and a fade out animation. At the end of this fade out animation i would like it to call upon a variable to know what page to go to next.I am trying to tell my main timeline to gotoAndPlay a frame based off of a variable within a movieclip(about_mc this movieclip contains another movieclip which acts like a button(factsheet_mc)) that i have set in my main timeline.I set the variable with:
var buttonFrame; in the first frame of the main timeline
then within my movieclip i have another movieclip which tells my main timeline to play the out fade and remember a variable:
this.onRelease = function(){ --------"this" meaning the movieclip factsheet_mc------------ [code]........
I have a base move that loads other movies into an empty clip [code]...
View 3 RepliesWhat I'm trying to do is control movieclips that are within a movie clip I have added to the stage.
First I did this:
var navcon:NavigationContainer_mc = new NavigationContainer_mc;
addChild(navcon);
This worked fine. But within this there is a mc called printBtn_mc that I want to target.I tried to declare it as a variable like I did with NavigationContainer_mc, but it doesn't work.
I want to play various sound objects a certain amount of times when the playhead reaches a certain frame and then stop playing (even if the playhead reaches the same frame again).
I hope someone will be kind enough to help me solve this problems I'm having controlling each sound.
Setup Details I'm using the load movie method to load another SWF (welcome.swf) file into a movieclip in the _root SWF timeline (main.swf), and using separate movieclips in the _root SWF as holders for each sound object i declare like so:
welcome.swf (its FLA file holds all the sound files in the library with linkage id's as per the following actionscript located as a frame action in frame 1:
[Code]...
I download a tutorial to make a digital clock now what I want to do is make my movieclips go to a different frame depending of the hour. I want to make that effect of day/night.
View 6 Replies[URL]
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side...
if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash?
I'm trying to create the very basics of a isometric map. My engine creates to map fine, but it's when I want to then control the movie clips.I'm adding each cell in the grid using and array:
Code:
for (var X= 0; X < Engine.Var.GridWidth; X ++)
{
[code].....
I am creating a Flash movie that has some PowerPoint-like pages in it. I've created an nice clipEvent script that make bullet points slide in and bounce to a stop. I want a whole bunch of clips to do the same thing, and I'd like simply to define a script globally at the beginning of the movie and apply it to all those different clips, that way if the client asks for changes I only have to change the one script, not dozens of them.
onClipEvent (load) {
originalH = this._x;
this._x += 500;
speed = 75;
pass = "right";
[Code] .....
I have a problem with attaching more than one movie clip to this control structure, I need to attach 8 different movieclips. Till now the code attaches only one mc the "window".
windows = 8;
for (c=1; c<=windows; c++) {
attachMovie("window", c, c);
}
I'm using AS3, CS5.5, on Windows764bit. I created an animation with many different layers (and nested movieclips) on the stage, then wrote a short bit of As3 to add a slider control of the playback. The problem/mystery is that when I change the slider, the nested MCs act strangely/independently. How to control everything at once? Here is the current file: [URL]
Here is the code I added:
package {import flash.display.*;
import fl.controls.*;
import fl.events.*;import flash.text.*;
//for TLF crap public class SliderClip extends MovieClip {
var slider:Slider;
public function SliderClip() {
[Code] .....
I am loading an swf created in flash professional cs5 via the loader class into a flex 4.1 application. The flash file contains multiple movieclips that are exported for actionscript and those movieclips exist in many instances throughout the movie.
Iterating through everything, comparing class types seems to be the most easy but also the most redundant way to solve this. Is there any way of using the class name as a kind of global selector to access the clips?
I could also make the sub-clips in the flash listen for an event on which they perform an action, but I am not really sure what might be best.
What I'm trying to achieve is a basic theatre Box Office application, to show the public the location of the seats that they have bought.
I've got 2 flash apps. One on the clerk side which takes the seats in a csv format and then uses local connection to send the data. [code]...
I have 2 swf files. One is loaded and loading an externally loaded swf into it.Here is the code in the first loaded swf: #1
var logo:Loader = new Loader();
logo.load(new URLRequest("images/Logo.png"));
logo.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadLogo);
function LoadLogo(e:Event):void
[code]....
EDIT:I am having major SANDBOX issues now when I make the clip load from an external URL. I am also coding for an ANDROID using FLASH CS5.5. Its not allowing me to use Security.allowDomain("*");
The proposed task has to do with the creation of an application in which the user will be able to insert, drag&drop and remove rectangles. The properties of each rectangle (name,x,y) should be saved in an xml instance.
1.Create a vertical toolbar with the above buttons:
a.new rectangle
b.move
c.delete
2.Create a movieclip that will be your workspace on the right of your toolbar named stage.
3.Create a function that will be triggered by the new rectangle button and will attach to the stage rectangles as movieclips named rectangle(i) (rectangle1, rectangle2,...).
4.Create a function that will be triggered by the move button and will drag and drop a selected rectangle.
5.Create a function that will be triggered by the delete button and will remove a selected rectangle.
And what I have done so far is:
i = 1;
newrectangleButton.onRelease = function() {
stageMC.attachMovie("rectangleID", "rectangle"+i, i);
stageMC["rectangle"+i]._x = Math.random()*stageMC._x;
[Code].....
so im making a portfolio website that is composed of 3 general movie clips all located on the main stage.
STAGE ---> mainscreenMC
---> recentworkMC
---> newsMC
[code].....
I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs. To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at http:[url].......
View 2 Repliesim trying to make a music/sound control and FX sounds control,so i have my FX volume level as a variable(FX_vol) and also the Music/sound volume level as a diffrent variable(M_vol),so i set them as sounds that i can use trough coding:
[Code]...
Is it possible to control a Flash movie from JS when you have no control over the source? I have decompiled the movie to see its inner workings, but I know nothing about Flash, so I'm mostly in the dark. I found this resource, Interaction with JavaScript, but it's not working for me (probably because I don't know what message to send to the movie).
View 1 RepliesI have a flex application and have embedded a flash (SWF) file into it using <mx:SWFLoader>. There is an "Exit" button on the Flash file. I want to be able to handle the button click event on the flex application.
So when that button in the flash file is clicked, I want to perform an action in the parent flex application.
I m trying to make sense of how to load a swf into a parent MovieClip and allow them to communicate.I ve attached two zip files � one which works fine and the other doesn�t. Unfortunately (for me), the one which doesn�t work is closer to my current project.I need to load movieclips into the parent movieclip. The parent movieclip has controls which rely on values parsed from the child movieclip.In the parent movieclips I wait until the loading is complete and so the values should be passed. However, the values aren�t passed unless I use a button (or timer), to pass the values (see the working exampes).The code which doesn�t work is:
Parent movieclip:
ActionScript Code:
stop();
var myLoader:Loader = new Loader();[code].............
I have two SWF-Movies. One is exported into eht other as Child.Can I instance the Objects of the two libraries in all places, where ActionScript is possible? (In Keyframes of the MovieClips and in external class definitions.)
View 3 RepliesLooking for a way to stop all movieclips both are the stage and that are children of the ones on the stage.
I toyed with looping thru stage's children so I can first target clips on the stage. But I am getting error.
for (var i:int = 0; i < this.numChildren; i++) if (this.getChildAt(i) is MovieClip)
{
this.getChildAt(i).stop
}}
I have created 25 MovieClips on the stage in 5 X 5 matrix.How can I treat 5 movieclips in each row as a group of movieclips so that I can apply same set action to them?(Similar to RadioButton functionality. )
View 6 RepliesPrinting an MC is easy enough. But I am having trouble printing an MC which has multiple MCs inside of it. They just don't get printed.
I am trying to avoid printAsBitmap.
I want to test mc animations without having to hit F12 to see if they work correctly. For instance, if I have an animation movieclip and then I make another movieclip and drop that aforementioned movieclip within, and animate [via the timeline or library preview] I'm unable to see on-the-fly what my animation looks like... it only shows the top most nest, unless I F12 it.
So if I have a character blinking eyes (one movieclip) and then I create another movie clip of the face, and put that aforementioned movieclip within, the preview animation within the library does not show how it'll be viewed when F12'n it.,,,, it'd be great to see your animations on the fly.