ActionScript 3.0 :: Access Function On Maintimeline?
Jan 28, 2009
I want to define a function on the maintimline and then from inside a movieclip I want to call a function.
In AS2 simply doing this could achieve the resuly _root.callFunction() but this is not possible in AS3
View 1 Replies
Similar Posts:
Jun 2, 2009
I need to access an array that's on the maintimeline from with in a movie clip im having issues with it.
The variable has all its info on the maintimeline but doesnt show up when i reference it in the movie clip So i tried referencing to the array var thumbURL:String =parent.thumbs ; and var thumbURL:String =root.thumbs ; but got an empty variable.
View 7 Replies
Aug 20, 2009
is there a way to access the maintimeline from within a movieclip?
root. doesnt seem to work
View 7 Replies
Feb 15, 2008
I have a .as class which calls an event function. When the event fires, I'd like the MainTimeline to play..
View 9 Replies
Jan 9, 2010
i have a MainTimeLine.as Document Class using as3 in flash cs4.it beginning looks like:[code]where the as file is declared in the Document Class of the primary fla file. under this primary fla file, i have a MovieClip symbol which points to another fla file. well this file declares a Class Linkage and i can access the properties and objects of the embedded symbol fine from the MainTimeLine.as script file.however, i have the above public player variable defined, as shown above, in the MainTimeLine.as code.i am having trouble accessing the player properties/methods from the embedded symbol fla file. how do i do that?
View 5 Replies
Jul 31, 2009
Short version : Im confused on the difference between the two when accessing something on the stage from a package. Longer version: I passed in a ref to the stage to the constructor on a class, and was unable to use it to access a dynamic text on stage. I pass in this instead and am able to access it.
[Code]....
View 3 Replies
Jan 18, 2012
Here's the scenario: We have a creative team that operates in Flash CS5.5 and produces SWF assets which have both graphics elements and actionscript code in them, and an engineering team which authors .as files and builds "code SWFs". The code SWF files must load or embed the creative assets and interact with the code therein for our apps to function.
For iOS mobile development, there is another consideration - it is not possible to load runtime code in an AIR app packages for iOS because of Apple TOS (see related question). Hence, it is not possible to use a Loader to load SWFs in an iOS environment and retain their code.
Embedding a SWF into an ActionScript file the standard way results in a Loader that loads the embedded SWF directly as bytes. This results in access to the top-level, main timeline as follows:
[Code]...
View 1 Replies
Mar 30, 2009
Found several suggestions, none of which have worked. I am sure I am probably overlooking something really stupid, so I need another set of eyes to look at my code. I have a main.swf that preloads and loads an intro.swf. On the intro.swf there is IntroMC that contains skip_btn. When the user clicks skip_btn, I need to call a function named traceMe() from the document class of main.swf. If you look at the comments for the intro.swf code, you can see the error I am getting.
Here is the code for main.swf
Code: Select allpackage
{
[code].....
View 6 Replies
Apr 17, 2009
How do i go about calling a function in frame 1 of my timeline from a class file?
my function TEST on frame one of main timeline is just using a trace.
This is my error:
1061: Call to a possibly undefined method TEST through a reference with static type flash.displayisplayObject.
View 1 Replies
Jul 27, 2011
I followed a tutorial to get this to work. I've been fixing new errors on this project for the past 5 hours.
ActionScript Code:
import flash.events.MouseEvent;
var imgurl:String = "img1.jpg";
[code]....
View 9 Replies
Feb 2, 2012
I keep getting the #1009 error coming up, i checked that everything was on my stage and was named correctly.This is the error message that comes up:TypeError: Error #1009: Cannot access a property or method of a null object reference.at Videogame_fla::MainTimeline/loop()Here is my code:
var carrot:Number = Math.floor(Math.random() * 460) +0;
var carrot1:Number = Math.floor(Math.random() * 460) +0;
var carrot2:Number = Math.floor(Math.random() * 460)+0;
[code].....
View 2 Replies
Dec 16, 2011
I have a class Debug with a function called trace inside it which puts a TextField on the stage and outputs the text. Now I am trying to get the Debug.trace() function to do a "normal" debug trace as well from within side itself. of course this causes a recursive loop. I am trying to figure out how I can access the top level separately. I tried using namespaces such as AS3::trace but to no luck.
I know a solution is to rename my function to stop the conflict, but I would like that to be a last resort. It is being used in quite alot of places throughout my entire code so replacing it everywhere is going to be a ballache.
View 1 Replies
Jul 29, 2010
Is it possible to access a function within a function in a parent swf from a loaded swf?
View 6 Replies
Jan 13, 2011
im trying to get back from a MC into my maintimeline:
i have a mc in wich i have buttons i have access them with the following:
function fn_logotipo_over(MouseEvent) {
movimentx=new Tween(MC_menu.btn_logotipo,"x",Regular.easeOut,-77,90,1,true);
}
MC_menu.btn_logotipo.addEventListener(MouseEvent.M OUSE_OVER, fn_logotipo_over);
Ok now that im inside that i want to navigate back so i can have access to other buttons that or outside of this MC and on the main timeline.
View 1 Replies
Mar 1, 2009
I am new to AS3 and I am going insane trying to figure this out. I have a blank (new) AS3 document, 00pixels x 200 pixels, with one (the first) frame.
[Code]...
View 9 Replies
Apr 25, 2011
I have almost everything working as confirmed through tracestatements, but when I insert my gotoAndStop("frame labels") in theAS file, there is no effect on the app.I know the button is working because inside the AS file I amtracing the button name to the output panel and it is correct. Ialso have assigned a Switch Statement to the clicked event in theAS file and that is correct also. It traces the correct outputs.But inside the Switch statement, where the gotoAndStop islocated it is not moving to the frame label. It doesn't move atall.I have tried the following:
this.gotoAndStop("label");
stage.gotoAndStop("label");
root.gotoAndStop("label");
this.stage.gotoAndStop("label");
View 4 Replies
Nov 27, 2011
I have an external swf called "lakefillpreloader.swf." It works, except when I put it in another swf, called lakefillwireframe. I get Error#1010 for the lines about ButtonMode and the EventListeners that gotoAndStop at different frames. What do I add to my code?
Lakefillpreloader:
Code: Select allclose_btn.visible=false;
buildings_text.visible=true;
//defines measurements, in pixels
const PANWIDTH:Number=10061
[Code].....
View 1 Replies
Aug 18, 2009
I'm loading a few external swf's into my file at runtime using load().Once each one is loaded I run a function on it to search through it's children.I use code similar to below to iterate through all the children and check if the name contains a particular string and then perform a function on it.
Code:
for(var k:String in theMC){
if(k.indexOf("character")==0){
[code]....
View 3 Replies
Sep 25, 2009
I've been trying to get a numeric value from an MC to the main timeline but cant seem to figure it out, i have tried "trace" and it works so i guess there should be a way to get a numeric value back to the timeline from an MC.
View 1 Replies
Sep 11, 2006
I have an external swf that I've placed in an empty movie clip using loadmovie into the main movie.
The swf shows and plays fine, however I have an interactive movie clip which does nothing when loaded into the main movie. (note: the loaded .swf is fine when tested outside of the main movie). How do I target the external .swfs interactive features after it has been loaded into the main timeline?
here's an example:
code in the external .swf-- on a movieclip, instance name: growObject
onClipEvent (enterFrame) {
if (_root.grow == 1 && this._xscale<300) {
[Code].....
I just need to figure out how to activate these instances while watching the external swf from my main movie timeline.
View 2 Replies
Jan 25, 2011
I have manually created a empty mc on the maintimeline named 'loadme'. I have my buttons in a movieclip that is on stage and within that mc i have the follwing code to one of the buttons:
[Code]....
I get an error 1119 when I run the swf. Also, is it possible to declare the variable for 'loader' on the maintimeline and then use it in my buttons mc?
View 4 Replies
Nov 15, 2011
I need to remove a MovieClip from the stage completely and keep it that way. The following code works just fine but when I come back to that frame later the MovieClip is there again.
Code:
removeChild(myMovieclip);
View 1 Replies
Apr 23, 2010
I am loading a 29 frame movieclip on fame 15 of the main timeline. Is there a way to have it continue playing maintimeline when it finishes. So when it gets to frame 20 of the movieclip AS sends control back to frame 16 of the maintimeline.
View 1 Replies
Jan 6, 2010
i am creating a package, MainTimeLine.as, to extend my main timeline. i use the FLVPlayback component under the package. however, i get the compile error:
1172: Definition fl.video:FLVPlayback could not be found. so i added the "import fl.video.FLVPlayback;" line to my MainTimeLine.as file, but flash gives the above error. now i had this problem when i added this code directly under a frame of the main timeline until i added a FLVPlayback instance to my library. now, i am trying to simply embed all of the code under the MainTimeLine.as file and have the as file encapsulate all of it. but, i still get that error.
so, how do i get flash cs4 to recognize and use the import properly
View 2 Replies
Feb 25, 2011
I have a movie clip button inside another movie clip. I want that movie clip button to take me to the main timeline, frame 1 (or any equivalent that would you restart the .fla).
View 2 Replies
Mar 9, 2009
I have four movie clip instances inside an instance. ("root" or "stage" > mcInstance1 > mcInstance2)
I have my actionscript codes enterd on the first frame of the mainTimeline.but my knowledge on actionscript 3 is so short I couldn't control the mainTimeline from the instances which I have created as buttons by actionscript coding.Here's what I'd like to do: When one of the movieclip instance is clicked and onEnterFrame,I want another movie clip instace to play which is on the mainTimeline (or "root" or "stage") on top of everything.I even tried to loadMovie and addChild to the stage onEnterFrame of the movieclip instance, but since it does the loadMovie inside instance stage, it appears only on top of the same movie clip instace and not on top of everything else.how to control a movie clip instance on mainTimeline inside the movie clip instance onEnterFrame in AS3.
View 1 Replies
Oct 3, 2009
I have managed to load an external text file in one place one the maintimeline. I would like to do the same thing on other frames. When I go to duplicate the same thing that I did on the first one I get a duplicate textReq request. Do I need to give the textReq a more specific name for each section? When I did this the movie wouldn't even recognize and of the code that was working before.I am attaching link so you can see sections I am talking aboutAlso you will notice that the swf file I loaded won't go away. That's another problem...ugh.Here is code on maintimeline:
stop();
import fl.transitions.*;import fl.transitions.easing.*;
import flash.net.URLRequest;import flash.display.Loader;import flash.events.Event;import
[code].....
View 7 Replies
Feb 1, 2012
The current problem with my code is everytime I press the play again button in frame 4 and I restart my game it goes twice as fast. So I asked my teacher and she told me it's something with the EventHandlers but I didn't used them in my code.She's of no help to me currently. Yes, education over here is worthless in a certain amount.. Personally I think error lies in this code: I also get the error called: TypeError: Error #1009 about a null object. It's at the MainTimeline/ enter_frame()..
import flash.text.TextField;
var upPressed:Boolean = false;
var downPressed:Boolean = false;[code]...........
View 3 Replies
Mar 8, 2009
Since my project uses class actionscript files my whole game project runs on one frame and nothing is on the maintimeline so there is only just one frame on the timeline. Just wondering how I could make it so that I could have the first frame with game instructions and a description which then goes into the game being second frame and when gameover goes to third frame using actionscript. or any tutorials or some peice of advice
View 3 Replies
Apr 18, 2010
I'm trying to load a swf onto my stage and I'm having some problems with the event handler. I'm getting an error: when I comment out the event handler, it returns no errors, I've tried the function both with and without void, but it doesn't fix the error. I know this should be an easy fix, but it's got me stumped.
[Code]...
View 1 Replies