ActionScript 3.0 :: X And Y Value To Reference To Main Timeline
Nov 8, 2009
I am positioning a movie clip within a movieclip, so obviously when I say for example:
ActionScript Code:
photo_mc.picture.x = 0;
photo_mc.picture.y = 0;
It positions the picture movie clip with in the reference of the photo_mc clip, and not the main stage. How can I reference it to the main stage (0,0)? - because the photo_mc moves around randomly, so to compensate would be pointless!
View 1 Replies
Similar Posts:
Nov 24, 2009
I have a simple problem that I've been working on for hours, trying to go through trial and error myself. But here's the problem. I have a function on the main timeline named startClips. Now, I want to call this from from within two movie clips, the other nested inside the other. In other words, I have a movie clip called holder, and inside of a holder, I have a movieclip called homebase. Now, here is all the code I've been trying to use to access the startClips function which is own the main timeline from the movieclip homebase:
MovieClip(root).startClips();
MovieClip(root.root).startClips();
MovieClip(parent.parent).startClips();
this.parent.parent.startClips();
I can't figure this one out. Can I get any assistance.
View 3 Replies
Aug 29, 2008
I'm having to convert an AS2 app to AS3. In the AS2 app I have nested MovieClip in which is a reference to the main timeline (sloppy practice, I know, and now I'm paying for it).
if(_root._currentframe == 3){ ...
which threw an error. I changed it to
if(stage._currentframe == 3){ ...
but it's still throwing an error. The same thing happens when I try to reference a variable defined on the main timeline...
var inPlay:Boolean; //on frame 1 of the main timeline
if(stage.inPlay){ ... // on a frame in a nested clip. This also throws an error.
View 1 Replies
Apr 8, 2010
this is one of those upsurdly basic questions for which google does not work. I have usually dispatched events from my classes and dealt with the user interface in the document class. But now i want to separate all the UI in a separate class, accessible by other classes. have added it as a child to the main/document class, but how do i reference the main class without going through parent.parent shananigans?dit. one more thing i remembered. Some of my UI elements are not programatically added.here is the code i have. i get possibly undefined property error.
package rpflash.ui {
import flash.display.Sprite;
import flash.display.MovieClip;
[code].....
View 2 Replies
Dec 13, 2006
im trying to tell my main movie to goto a certain movieclip in the timeline from my loaded external swf heres the code Im working with,[code]I can tell the script is executing because the external movieclip unloads itself but the main movie does nothing.
View 1 Replies
Sep 30, 2009
How would I reference a button instance on the main timeline in the actionscript within a movie clip symbol?For example: btn1.addEventListener (MouseEvent.ROLL_OVER, main1Over);where btn1 is an instance of a button on the main timeline but is not found within the symbol itself.I will then be dragging that movie clip onto the main timeline when it's finished.
View 3 Replies
Nov 24, 2009
I have a function on the main timeline named startClips. Now, I want to call this from within two movie clips, the other nested inside the other. In other words, I have a movie clip called holder, and inside of a holder, I have a movieclip called homebase. Now, here is all the code I've been trying to use to access the startClips function which is own the main timeline from the movieclip homebase:
MovieClip(root).startClips();
MovieClip(root.root).startClips();
MovieClip(parent.parent).startClips();
this.parent.parent.startClips();
View 8 Replies
Mar 31, 2010
I've been programming with AS2 for a few years and I just made the switch to AS3. I'm hoping there is an easy solution to this problem. I have a class 'Actor' (extends MovieClip) that needs to hitTestPoint on a nested MovieClip 'root.World.walls' in a function moveRight(). The line of code looks like this: ...while (MovieClip(root).World.walls.hitTestPoint(pnt.x, pnt.y, true)) {... But I keep getting various errors when I try different solutions.
View 1 Replies
Oct 16, 2009
I have 3 functions in my main document class that I want to execute when the main timeline reaches a particular frame number. how do I do that?
see the code and comments
public function mainClass()
{
//stage declaraction
stage.align = StageAlign.TOP_LEFT;
[Code]....
View 5 Replies
Jun 10, 2009
why the timeline inside these movie clips and the timeline on the main scene have to correspond to work. [URL]
View 1 Replies
Feb 2, 2010
I cannot seem to find anything of what I need from google.(Well, I can find the reverse method to what i need ) Basically I wish to access a variable declared in the Root Timeline from my Movie clips timeline.
[Code]...
View 2 Replies
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
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
Oct 9, 2009
I have a file comprised of 1 scene and two movie clips. The clips are instanced into the Main Timeline and occupy Frames 1 and 2 respectively.MovieClip1 is an animation that has navigation buttons that appear at the end of the clip. I'm trying to get mouse click navigation to make Frame 2 on the Main Timeline active.
Here is what I'm trying but it is not working:
btExplore.addEventListener(MouseEvent.CLICK, ExploreClick);
function ExploreClick (evt:MouseEvent):void {
gotoAndStop(2);
}
this takes the animation to Frame 2 of the Movie Clip Timeline not Frame 2 the Main Timeline.
View 9 Replies
Jul 4, 2009
I'm having some problem with the workflow of flash.I make web banners everyday att my work att it is important to me to have the banners easy structured so I can copy effects, tweens and symbols to a new banner. I have Flash CS3 pro.I always start by making a symbols. And then in the symbols own timeline I make the animation or effect.
The big problem I'm having is when I have the main (scene1) timeline with many frames, and then have symbols on that timeline, with it's own timeline with some frames. The frames in the symbol timeline is okey, but at the main timeline the frames is too short or too long so the animation of the symbol cuts of early or it plays more than one time (too many frames).
How do I calculate how long a symbols timeline should be so It maches the main timeline?What happens to me is that I always have to adjust the symbols timeline and the main timeline, and this I have to do many times.
View 2 Replies
Jul 14, 2009
so here's the function on main stage:
[Code]....
and here's the code that wants to call this function in a another movie clip. I've attached this clip dynamicaly to the main stage as well.
[Code].....
How can i acess slideImage function on the main stage. in AS2 _root.slideImage(btnNumber); would work. How Would I do this in AS3?
View 7 Replies
Dec 30, 2009
I have a main.fla which has 3 movieclips inside it. All 3 mc's have timelines that run 40 frames. The main.fla timeline has each mc instance on a frame. mc_1 is on frame 1 mc_2 is on frame 40 mc_3 is on frame 81 as the main timeline plays the clips each one fades to the other. I need to know how to target this scenerio after mc_3 plays I need to have a goToAndplay (20) set up so the animation inside mc_1 starts playing (frame 20) of mc_1.
View 5 Replies
Mar 13, 2011
I have a magic cloud effect. On frame 30 of the nested effect I would like an mc on the main timeline to become visible.Not too sure how to code with frame numbers,a) Do I put AS on the timeline of the nested clip ORb) Write code on the main timeline to listen for when the nested mc gets to frame 30
View 5 Replies
Apr 5, 2005
I have a movieclip on the scene. I also have a button on the scene and when I press the button I want to send a variable-value to the movieclip. I have a variable set in the actual frame on the main-timeline but the movieclip doesn't catch that, when traced I get undefined. Can I send a value from the main-timeline to a moviclips timeline?
View 3 Replies
Aug 30, 2009
On my main timeline, I load a mc from the library with:
text_content.attachMovie("text_content", "text_content", 10);
There is a marker inside this mc called "news". I need a script in the main timeline that will gotoandStop "news" within the "text_content" mc.I have tried, amongst others
[code].....
View 4 Replies
Apr 5, 2005
I have a movieclip on the scene. I also have a button on the scene and when I press the button I want to send a variable-value to the movieclip. I have a variable set in the actual frame on the main-timeline but the movieclip doesn�t catch that, when traced I get undefined. Can I send a value from the main-timeline to a moviclips timeline?
View 3 Replies
Nov 22, 2011
How do I link a button thats embedded in frame 2 (music page timeline) to a frame in the main timeline ( frame 3= biography page)? Both pages are on the same scene with link buttons embedded in each page independent timeline.
View 1 Replies
Aug 9, 2010
I am trying to "gotoAndStop" on a frame in a nested timeline from the main timeline, but can't seem to figure out the correct way to write it with it's 'parents' etc... this is how I have tried which makes sense to me (have tried other ways too) but no success.
gotoAndStop(parent."framename");
View 3 Replies
Oct 27, 2010
Right now I have a library that does something like this:
public class Main extends Sprite{
public function Main():void {
MyLibrary.init(this);
// the rest of your code goes here
}
}
I need the user to do that since I need a reference to the current DisplayObject since I need to access loaderInfo.sharedEvents
Is it possible to get a reference to the displayobject or to the loaderInfo of the movie currently being played (maybe it's a static var of some class?)?
I was thinking on something like. flash.system.ApplicationDomain.currentDomain is there something like.. flash.display.DisplayObject._root?
In AS2 this would be trivial but I'm afraid this may not be possible in AS3 .. and I really need to get rid of that "init" call.
View 2 Replies
Feb 22, 2009
In de Flash IDE I create this movieclip 'MC1' and assign class MC1.as to it.
On the timeline, I add a textfield 'TF1'.
Now, in MC1.as I can change the textfield easily: TF1.text = 'text here'.
This works perfectly and I should not complain... however;
Is there a way I can tell my class MC1.as that there is a TF1 that is a textfield? So I can use codehinting?
If I add
Code:
var TF1:TextField;
the reference to the textfield is lost and now NULL. So that does not work.
View 1 Replies
Jul 12, 2010
How 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.
View 9 Replies
Jul 22, 2011
I've been trying to reference a Library symbol that is introduced in Frame 2 by using it's instance name, using timeline scripting only. I am trying to make a colour picker MC symbol for multiple re-use. Firstly I drew a small button on the stage and converted to MC, called textColourPicker of type CPicker (the class used to represent this MC in the Library). Inside this MC I have a button symbol called pickerButton
[Code]....
View 1 Replies
Dec 12, 2009
I'm loading a lightbox as an image gallery, but I'm working on changing it to full flash. My site is structured with external swfs. I ran into a barrier, because I'll need to load the images (and reference the stage size) in the root timeline, but I don't know how. MovieClip(root) only references the smaller loaded swf's main timeline.
View 1 Replies
Aug 17, 2011
I modified an Adobe Flash CS5 sample to create a swf with a preloader. In my FLA I've two stopped frames:In the first frame I only put this code (and a textfield showing percentage):[code]When I test the Adobe sample (it has no main class on frame 2, only a large image) anything works fine, but when I compile the modified version I get strange errors. In the Main class constructor I reference three movieclips, eg. this way: myClip.alpha=0, but it seems now Flash can't see them anymore (they are null). Why?
View 1 Replies
Jan 17, 2011
I'm using Flash Professional cs5/AS3 I'll try and describe this the best I can. I'm new to ActionScript. So, in my timeline I have a var on a frame that represents "lives" and i have some code in the timeline that takes down the number of lives depending on certain events, which all works great.
so, now i wanted to make a constructor class that I could reuse for a bunch of movie clip objects and I only want these objects to be able to move if the lives variable is greater than certain number. So now, building my constructor class for these objects i just wanted put an if statement that is looking to see if the lives are greater than a certain number, which if it is then should make these objects do what i want...But, when i run the project I get "1120: Access of undefined property lives."
lives is the var I made obviously like I said, and it works fine being referenced everyone else except when I make a new .as file for these objects then try and reference it. I get the same error when I try and establish "lives" in the main project class too. I'm not sure where I should put this var or how I can make it so i can reference it from an object class. I'm not really sure how to word or describe my issue which has made it hard to search for a tutorial.
View 3 Replies