IDE :: Why Does Parent Correct Function Not Working

Sep 19, 2009

In actions in my .fla file I create a new object of a class (addChild) which is in an separate .as file. Now, in my .as file I want to call a function in the .fla file. This should be the parent right? So, I try parent.correct(); which does not work. I get the error #1061 (call to a possibly undefined method). However, when I do this:
var par:* = parent;
par.correct();
Everything works. Why is this?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Child Call To Parent Function Not Working

Jan 12, 2010

I have a main MovieClip that creates a new instance of an imported class which is a page in the application. This class tries to call a function on the main MovieClip and it's not finding it. I've done this in the past without any problems with separate swf files and loaders, and with movieclips in a library. I'm at a loss on how to resolve this. Here's what I'm doing (simplified for posting):

[Code]....

View 5 Replies

Actionscript 3 :: Access A Parent Class In An OOP Correct Way

Mar 11, 2012

I just started programming OOP and I'm running into a scope problem. In the following project, I have a masterClass called App. The App-class has Screens:Screen-class and a Navigation-class as it's children. From the navigation class I want to control which screens will be displayed. I don't know how to do this.

[Code]...

View 2 Replies

Javascript :: Php Null Object Given By IE But Other Working Correct

Mar 1, 2011

there is a problem with IE browser it does not recognize object HTMLEmbedElement and not proceed for further execution . i have no choice because there is nothing to be updated in programming code

View 2 Replies

ActionScript 3.0 :: Next And Previous Buttons Are Not Working Correct

Jul 10, 2011

why the buttons are not working correct?

View 2 Replies

ActionScript 2.0 :: HitTest / LocalToGlobal Not Working - Traces Out To The Correct Location

Feb 12, 2010

So I am able to trace the correct coordinates. However the hitTest fails. Here is my code:

[code]....

View 1 Replies

ActionScript 2.0 :: Correct Function/xml Game?

Dec 6, 2006

I am making a matching game for my company. I created an xml document to load in flash of medications and their descriptions. I used a dropdown menu component to load the categories the user can choose from and randomly load a med from that category. If they match it correctly, I want that item to disappear from the list to randomly load in that category.

However, the way it is working is...it does not randomly load a med (it loads the first item in the list [0]), it does not keep looping through the categories, nor does it remove an item from the list. I imagine if I can get direction to properly/initially load and randomize the data, that I can figure out the rest from there. I have been working on this for a long time...and I am stumped.

var Answer:Array;
var checkAnswer:Array;
//------------------Load the XML,populate the combo box and load med info into categories---------------------------------
import mx.utils.Delegate;

[code].....

View 1 Replies

ActionScript 3.0 :: Access A Function Within A Function In A Parent Swf From A Loaded Swf?

Jul 29, 2010

Is it possible to access a function within a function in a parent swf from a loaded swf?

View 6 Replies

Flex :: Setting The Correct Sort Function At Runtime?

Aug 27, 2009

Using Flex 3.2, I have a object which extends a TitleWindow. In this TitleWindow I have an AdvancedDataGrid.

On creation of this object, I pass it 2 lists, one full of data to display, and the other I pass an array of column definitions. This allows me to, at runtime, create the correct columns and define the correct display attributes for each column (e.g. booleans will show up as checkboxes, and dates are formatted in a specific format (coming in from an XML feed in a variety of STRING formats where nulls are a possibility)

The problem is that the default sort, being based on string, doesn't work 100% of the time and even when the format is one that would be sorted nicely, it fails when nulls are involved.

The above problem would be easily solved using a sortCompareFunction, but the fact is when you set the sortCompareFunction of the column, it seems to require you to hardcode in the column name into the function.

for reference here's the function I'm using to create the columns:

private function setupGrid():void
{
var localcols:Array = new Array();

[Code].....

View 3 Replies

ActionScript 3.0 :: Get The Depths Of All The Blocks To Be At The Correct Levels At The Correct Times

Dec 30, 2009

I'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?

View 4 Replies

ActionScript 3.0 :: DispatchEvent To Parent Not Working?

Sep 9, 2009

As I'm working on a simple XML photo gallery, I am having a bit of trouble making my Slide class successfully dispatch an MOUSE_OVER and MOUSE_OUT event to the Main class.

Main.as

Code:
// add a new slide
var slide:Slide = new Slide(_slideHolder, "slide_" + no, _xml.img[no], x, no);
slide.addEventListener(Event.COMPLETE, imageLoaded);

[Code]....

When I hover over my sprites, the functions inside Slide.as gets triggered - but they don't pass the event to Main.as as I would have expected.

Strange thing is that the Event.COMPLETE gets triggered inside Main.as.

View 1 Replies

ActionScript 3.0 :: RemoveChild In Parent MovieClip Not Working

Jun 2, 2011

I am trying to remove a movieclip from my main timeline but it is not working. you click a button that is in a movieclip that is dynamically added to the stage and it is supposed to remove a movieclip from the main stage. I added a trace to see if it was grabbing the right movieclip and it is. The error message that I am getting is:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

package MarketingQuestionaire
{
import flash.display.MovieClip;
import flash.display.DisplayObject;

[Code]....

View 3 Replies

ActionScript 3.0 :: Working On Transition - Strict Mode And Parent

Jan 23, 2011

I'm struggling with the transition to AS3, specifically not being able to use parent like I used to. Aside from it making me a better coder, are there any good reasons to use strict mode? If I dont use it, are there any 'side effects' to my swf I should be aware of? Any input on parent and strict mode.

View 5 Replies

Actionscript 3 :: Parent.AddChild Not Working After Protecting Swf Using SWFProtection?

Apr 22, 2011

I usually, use SWF Protection, to protect my swf's from decompiling. It also adds a load bar to the swf.

The problem is that I have codes like this:

logo= new marca();
parent.addChild(logo);
logo.mouseEnabled=false;

I use parent, because I need to put the movie clip above everything, because my application allows the user to add a lot of things to the stage, so a don't want anything covering the logo.

The application works well while unprotected, but If I protect it using SWF Protection, then, I get just white screen. Nothing appears after loading.

Is there another way, to put a movieclip above everything, without being necessery to add a ON ENTER FRAME LISTENER, to update the movieclip deph, to keep it above everything?

View 2 Replies

ActionScript 3.0 :: AddChild() Not Working On A Parent Class Of MovieClip

Oct 27, 2009

What I describe here is not correct. My full code had some other things in it that was the reason I couln't see mc2. The code described under is actually working!

I have custom class (MyContainer) that extends Sprite. Then:

Code:
var mycon:MyContainer = new MyContainer();
var mc1:Sprite = new Ball(); // Ball is a sprite in my library
var mc2:Sprite = new Ball();

[Code]....

it works, but I dont want that, as MyContainer has custom variables and functions I use. A simple: if (mycon is DisplayObjectContainer) evaluates to true.

View 0 Replies

ActionScript 3.0 :: Visible = False; Not Working For Parent File

Jan 27, 2011

So i have my index.swf file with an mc called "loadingspace" (as instance) who appears on a 10 frame animation.

At the 10th frame i have placed this code:

Code:
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("http://www.mysite.com/preload/preloader.swf"));
addChild(my_loader);

[Code]......

View 3 Replies

ActionScript 3.0 :: Positioning Parent MC In Order To Center Child MC On Parent's Parent MC

Feb 5, 2010

[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]

View 2 Replies

ActionScript 3.0 :: Flash Functional Buttons Stop Working After Reopening Parent Mc?

May 30, 2010

i'm a flash newb, wrestling with actionscript 3 and ran into a problem with a drop down menu.the menu is composed of nested movie clips that open and close, and contain buttons that control a ui loader in scene 1. it seemed to be working all right until i realized that after opening and closing and reopening a submenu, the buttons that worked the first time stopped controlling the ui loader. since there aren't any error messages i'm kind of at a loss as to what needs fixing.

View 7 Replies

ActionScript 3.0 :: Grabbing The Parent Of A Function?

Mar 23, 2009

I'm having trouble adjusting to the way functions pass in AS3. How come when I say "this" it doesn't know I'm refering to AudioTrack?

PHP Code:

var AudioTrack:Object = new Object();
AudioTrack.myVar = "Hello";
AudioTrack.onComplete = function(){

[Code]....

View 2 Replies

ActionScript 3.0 :: Calling A Function On Parent Swf

May 11, 2009

new to actionScript and trying to finish my final project, and i'm banging my head on a brick wall now, my question may be easy for some pros, basically i've loaded an external swf from a button at main.swf

[Code]...

this works fine. then i'm trying to disable the button function while the swf is loaded. I add another eventListener to the same button. function disableMenu( e:MouseEvent ):void { button1.mouseEnabled = false;}

that works too. ok now comes the problem. I have a close button on my child swf("content1.swf) to close itself and returen to main swf. but I want the button on main.swf to work again. so at the close button I add another eventListener hope to enable the menu. (note this is on the child swf!)

[Code]...

View 13 Replies

ActionScript 3.0 :: Calling A Function Of A Parent?

Aug 5, 2009

I have two movies... main.swf and content.swf, and I'm trying to call a function in my main.swf from my content.swf. Here is the code..

//function in main.swf
function appear (event:MouseEvent):void{
TweenLite.to(title1, 1, {autoAlpha:1, overwrite:false});

[Code].....

I got an error message as soon as i click on close_btn. It says appear() is not a property or method.

View 0 Replies

ActionScript 3.0 :: Targeting A Parent's Function?

Aug 13, 2009

I've created a Preloader.as class. When the preloader finishes loading, I'd like it to call a function from it's parent (the document class).This is the error I get:

Code:
1119: Access of possibly undefined property startApp through a reference with static type flash.display:DisplayObjectContainer.

[code].....

View 9 Replies

ActionScript 3.0 :: Call Function In Parent

Jan 29, 2010

i have a swf that loads a swf that loads one swf into that one. i need the final swf (child, child) to be able to call a function on the first swf (parent)

i have tried this:

if(MovieClip(parent.parent.parent)!=null){MovieCli p(parent.parent.parent).parentFunctionCall();}

[Code].....

View 0 Replies

ActionScript 2.0 :: Calling Function In Parent Swf

Apr 13, 2010

So, my problem, I have a Parent swf file that loads a bunch of smaller swf files. When I click on a button in one of these loaded swf files, I want to be able to call a function from the parent swf. Once called, the function manipulates things MC's within the parent swf.

View 2 Replies

ActionScript 2.0 :: Access A Function Of The Parent Of An MC?

Oct 5, 2005

Well- actually, my problem is a bit more abstract than this thread's title suggests..ere's the setup:I have a parent function (called "Game") with a couple of subfunctions.There is one subfunction ("Game.prototype.spawnBonus") that, as the name suggests, spawns a Bonus Item by duplicating a movieclip.The duplicate movieclip is created on "_root"-level and has an onEnterFrame attached to it that checks whether a certain stage is met (all this works).Now the problem is, when the case is met, I need to access a subfunction of "Game" and pass it the MC's ID to fade out the Bonus Item. Like so:[AS]Game.prototype.fadeBonus =

function(number) {
// just some stuff to fade out the MC with the number
// passed through the value "number". This works well,

[code].....

View 3 Replies

AS 3 :: Child Call A Function In Its Parent?

Mar 7, 2009

I have a function (let's call it testFunction for right now ) on the actions layer in the main timeline There is a movie clip with 15 frames long in the library

i want to add a child of the movie clip on the stage, and call testFunction when it finishes playing

how can i do? i tried to call it in the child but nothing works

Or, is there any way to show child on the stage for only a period of time like 1 second and then remove it automaticly?

View 1 Replies

ActionScript 3.0 :: Calling An Function On Parent Swf

May 12, 2009

new to actionScript and trying to finish my final project, and i'm banging my head on a brick wall now, my question may be easy for some pros,[code]this child swf is loaded from xml. and the close button is created by using AS file. The "button1" is just on the stage of the main swf. Maybe these make some difference so i can't just point it back using (root)?Any idea how do I resolve this? Or am I not supposedd to do it this way at all?

View 2 Replies

ActionScript 3.0 :: Calling A Parent Function?

Jan 29, 2010

i have a swf that loads a swf that loads one swf into that one. i need the final swf (child, child) to be able to call a function on the first swf (parent)

i have tried this:

if(MovieClip(parent.parent.parent)!=null){MovieCli p(parent.parent.parent).parentFunctionCall();}

[Code]....

View 2 Replies

ActionScript 3.0 :: Get Parent To Execute Function In Child?

Jun 22, 2009

I have a function in a child that I need to have executed by the parent but I can't get it to work. Does anyone know how to call the function in a child from a parent?

What I'm doing is having the parent load a few buttons and I want to re-use the button swf, but have the parent provide the text for the button.[code]...

View 20 Replies

ActionScript 3.0 :: Parent Calling Child Function?

May 23, 2011

May i know how to call child function(layer 2) in parent(layer 1)?
 
Layer 1 (Parent)
function changeAction():void{
changeColor();
}
 
This method will give me the error -> Call to a possibly undefined method changeColor.
 
Layer 2 (Child)
function changeColor():void{
trace("success");
}

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved