ActionScript 2.0 :: Access Function In Different Frame?
Jul 3, 2009Is there a way to access a function that is in a different frame?
View 1 RepliesIs there a way to access a function that is in a different frame?
View 1 RepliesTried to access a function in the document class by simply calling it. For exampe, the code in my frame is:
Code: Select allinitButtons();
And in my document class I have the function:
Code:
Select allprivate function initButtons():void{
trace('anything');
}
But it gives me an error. Even tried to change private to public the same.
how I access variables in a frame on the stage with code from a frame within a movieclip?(basically passing variables from a stage frame to a movieclip frame)
View 4 RepliesI 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.
Is it possible to access a function within a function in a parent swf from a loaded swf?
View 6 RepliesI'm trying to get this function to target myClip_mc and movethe frame head to another frame label.
var counter:Number = 1;
//textBeGone
invisible_btn.onRelease = function(){
counter++;
if(counter % 2 = true) {
[code].....
OK, I am trying to get the following functions to load and unload the video to my main timeline when I go in and out of a frame. I tried on Enter_FRAME but it is now working properly and load many instances.
What are the listeners I need to do to call the functions of oCoach when enetering a frame and fclickCV when leaving a frame?
[code]...
i have a pb of memory leak:i using flash.media.video to read video i have function to do frame by frame:FrameBuffer is an Array containing my video frame, lastimg is Bitmap object
[Code]...
I want to call a function once per frame between keyframe 1 and keyframe 60, but i don't want to have to create a keyframe on EVERY single frame in between with an action calling the function. is there a simple way like tweening, to make this function execute once on every frame without having to make 60 unique keyframes?
View 1 RepliesI use flashIDE(CS5) to create and organize my assets for flash game. Some movieclips need to have specific params.I am typing them at a MC's first frame:
var shape :String= "circle";
var material :String = "wood";
And then make them Export as MovieClip.For AS3 coding I use Flash Builder 4. When I create new Instance of this MC and trace values I get "null". But if before trace gotoAndStop(1); typed then my values are ok ("wood", "circle").
I have a FLA file and bind it to a class. I need access some instances on the second frame of the FLA file from the class, but I failed because they are not instanced yet.
View 2 RepliesI have a FLA file and bind it to a class. I need access some instances on the second frame of the FLA file from the class, but I failed because they are not instanced yet.
View 1 RepliesI have a movieclip that has everything for my flash program inside of it. Its called Main, sitting on the root timeline. I have some code within Main, and I am trying to get it so that I can gotoAndPlay a frame outside of Main (further down the root timeline than where Main is sitting. How can this be done?
View 2 Repliesimagine that i have index.swf .on the first frame of it the main.swf will load .now i want to go to next frame of index.swf ( that contain action code for loading some other swf file ) from main.swf by clicking on a movieClip .how can i access to index.swf form main.swf ?
View 1 RepliesI have movieclip its instance name is mc, located in the 9th frame on the main timeline.It has more than one key frame. Inside this movieclip there is a FLVPlayback its instance name is vid which is located in the 9th frame on the timeline of the movieclip. I want to access the FLVPlayback using AS2 and AS3. Here is my code, which is not working:
[Code]....
I name frame 50 "_foo" (in the IDE)
I can trace this._currentframe at any time (and get a number)
I can gotoAndPlay("_foo");
But how can I find out if the current frame IS "_foo" as the movie plays?
how do I access the variable from another MovieClip and frame? That's about the structure of the clip:
Layer1:ActionscriptA(Frame)
Layer2: MovieClip1+
-----------------|_layer2: BoneColor(MC) +
[Code]...
I tried to do this differently, for example
var clr:BoneColor = MovieClip1.BoneColor.ActionscriptB.clr
Here is the thing : I have a several frames on which I have several MCs. logical.
On some frames, I have MCs that have the same name that on other frames. Right now, I access the frames by a gotoAndStop() and then access the MCs of the frame in the very frame. What I want to do : I want to be able to access the MCs of all the frames from the first one to initiate them (loading purpose). But since I have MCs with the same name, I can't juste do "MCName.whatever()" because as wouldn't know which one to chose. So here's my question : is there a way to use the object-like syntax to prefix the MC Name by it's frame ? ie : frame is "Frame2"
[Code]...
Is it possibile to access a mc, which is present in next frame? While we are focusing in the previous frame. I need to feed some data for the mc which is in next frame. So, How to get that name of the mc?
View 1 RepliesI have a several frames on which I have several MCs. logical. On some frames, I have MCs that have the same name that on other frames. Right now, I access the frames by a gotoAndStop() and then access the MCs of the frame in the very frame.
What I want to do : I want to be able to access the MCs of all the frames from the first one to initiate them (loading purpose). But since I have MCs with the same name, I can't juste do "MCName.whatever()" because as wouldn't know which one to chose.
is there a way to use the object-like syntax to prefix the MC Name by it's frame ?
ie : frame is "Frame2"
mc is "myMC"
=> do Frame2.myMC.whatever()
how to access an object property from a different frame. This is my code:
Frame 1:
var HelloWorld:Object = new Object()
Frame 2:
Number = 5
HelloWorld["Planet"+Number] = function(){}
HelloWorld["Planet"+Number].Person = "John"
[Code].....
So how could I make it accessible from all frames? I've tried adding _global to the code on Frame 1 but it still wouldn't work...
i have created this matching game from thing ive learnt. but im haveing a prob.when the game over function is run i want to; gotoAndStop("gameover") frame lable but it wont work here is my code
ActionScript Code:
package
{
import flash.display.*;
[Code]....
I have two frames, and I would like to set the textfield's text on frame #2 of the textfield's content on frame #1. How can I do this? Here are the codes: Frame #1(I've got an input textfield(bemenet) and a button(gonb) on it):
Code:
stop();
gonb.addEventListener(MouseEvent.CLICK, klikkol);
bemenet.border=true;
bemenet.textColor=0x000000;
[Code].....
After run, and clicking the button, I've get an error message: Cannot access a property or method of a null object reference.
I've been having a few problems with accessing an array from a different function.
The array I want to use is from the makeFly function, which generates instances of the Fly MovieClip. I want to access the array from the paperSwing function, which should test for a collision between the mouse cursor and the fly movieclip, and then if true remove the instance. This is the part where I'm having a bit of trouble, I'm not sure of how to access the array "name[i]".
This is from the "Main" Document class:
Code:
package {
import flash.display.*;
import flash.events.*;
[Code]......
I'm having trouble accessing the turnQueue array which is being updated in the first function and accessed in the second, no idea what the rules are between functions for actionscript. Heres the code, I want the turnQueue to be growing as keys are pressed, and at the moment its not updating from the first function.
public function keyListener(e:KeyboardEvent):void {
trace("Key Entered");
if (e.keyCode > 36 && e.keyCode < 41) {
[code]....
trying to load some xml into flash, then use the xml data from another Function - but get Access to undefined property myXML
Is there a way of doing this or do i need to populate an array with the xml data?
ActionScript Code:
//------------------
// Load XML
//------------------
var xmlLoader:URLLoader = new URLLoader();
[Code]....
How can i access an object (movieclip) at a specific frame which is located inside another movieclip. It's something like this : first movieclip - and inside it, on frame 10 i have the second movieclip. I want to access that second movieclip ont that 10th frame.
View 1 RepliesI have movie clip in an array (newStep) that is being added to the stage dynamically. It's randomly choosing a frame to go to every time an instance is added. There is a nested movie clip (stepLine) that i need to change the alpha of. This code actually works for adding a string to to the dynamic text box (pointsDText) but when i try to access the nested movie clip (stepLine) it gives me 1009 null object reference error. The funny thing is the code actually works and does change the alpha of the movie clip but i still get that error, and i think it's making my game more glitchy. I've tried using if(contains(steps[r].stepLine)) too but it doesn't work. Is there a better way to access this movie clip without getting the error?
if(newStep != null){
for(var r:int = 0; r<steps.length;r++){
if(steps[r].currentLabel == "points"){
[code].....
I trying to access a flashvar on the first frame but they are alway undefined. What am I doing wrong? Embed:
[Code]....
I want to know how to access a variable that was declared in a completely different frame. How do i make it global or whatever in as3?
View 9 Replies