ActionScript 3.0 :: Altering Properties Of Loader Added As Child?

Mar 26, 2010

I have a holder movieclip on screen, then I create a loader, load an external SWF into the loader and addChild to my holder:

var bgloader1:Loader = new Loader();           [code].....
 
This all works.  Now if I want to come back later on and alter the alpha or position I get an error:
 
//Neither of these work:            MyHolder1.bgloader1.alpha=0;            MyHolder1.bgloader1.content.alpha=0;
 

TypeError: Error #1010: A term is undefined and has no properties. at flash.events::EventDispatcher/dispatchEventFunction()    at flash.events::EventDispatcher/dispatchEvent()    at flash.net::URLLoader/onComplete()

View 7 Replies


Similar Posts:


Actionscript 3 :: Can't Access Properties Or Methods Of MC Child That Has Been Added In Script

Apr 24, 2010

I have created a loop to instantiate tiles on a board. In the following example, "Gametiles" is an array containing objects of class "Tile" which is a class that extends MovieClip. "Game" is a MC that I added to the stage in the flash developing environment.[code]This method is a bit cumbersome though. I really don't want to have to create a var and call getChildByName every time I want to interact with these properties or methods. How can I set up these children so that I can access them directly without the extra steps?

View 1 Replies

ActionScript 3.0 :: Looping Through An Array Of Objects And Altering Their Properties?

Sep 7, 2009

ActionScript Code:
for (var i:uint = 1; i<=10; i++) {
var ball_array:Array = new Array();
var newBall:ball = new ball();

[Code].....

View 4 Replies

ActionScript 3.0 :: ADDED Event In Loader.load And Loader.loadBytes

Sep 13, 2010

I got this very strange behavior from FlashPlayer debugger 10.1 r82. When I call loader.load method, no ADDED event is dispatched to the loader object. But if I open the file and call loader.loadBytes instead, an ADDED event is dispatched to the loader object. I suspect the ADDED event is dispatched because the content is being set as the child of Loader object, but why in the other case it is not dispatched?

View 4 Replies

Flash :: Set ScaleX Property On A Sprite Without Altering The Child Inside

Mar 25, 2010

My site is set up with next and prev buttons on the right and left sides respectively, and as you roll over either of the hit areas around the buttons a Sprite fades in which contains a TextField that describes the next page. Said Sprite calls the StartDrag() method, so it follows the mouse within the bounds, which is all fine and dandy on the left side of the page. Adobe, however, seems to have forgotten to put a way to dynamically alter the registration point of a Sprite, MC, whatever else, so when you roll over the right side of the page, the sprite is displayed from the top left and is mostly off the stage.

Trying to hack this problem I have tried numerous things ( classes written by others, other hacks) and the best that I have found is to use the scaleX method on the Sprite, changing the scale to -1. This, of course, makes the Sprite seem like it's reflected from its normal point, which means all its children show up backwards.

Is there anyway I can use this hack without it altering the text?

OR

Does anyone know a different way to go about displaying a Sprite from another corner? Any way to make a Sprite fade in and follow the mouse on the LEFT HAND side of the mouse pointer?

Here is a snippet to give an idea of what's happening:

naxtPage.labelBG.scaleX = -1;
nextPage.labelBG.startDrag( true, nextHitRect );
nextPage.labelBG.x = nextPage.labelBG.parent.mouseX;
nextPage.labelBG.y = nextPage.labelBG.parent.mouseY;

View 1 Replies

ActionScript 3.0 :: Add Child To An Added One?

Jul 21, 2011

I am making a simple xml gallery that loads in images into a movie clip that looks like a Polaroid. So, the idea is that flash will see how many image need to me imported. Then in the for loop it will add child the Polaroid mc (which has been exported for actionscript and the class named "Polaroid"). The inside that Polaroid mc there is an empty mc called "polimageHolder_mc" that I want to load the xml loaded image into. I keep getting this error "TypeError: Error #1010: A term is undefined and has no properties", when I use the code below. It makes sense to me but my syntax is obviously incorrect. [code]...

View 3 Replies

ActionScript 3.0 :: Getting TextInput From An Added Child?

Jun 24, 2010

So when you win my game I add a movieclip that will let you enter your name through a text input component. Unfortunately, I'm calling it wrong.

I'm getting an undefined property error because it's out of the youWon function, right? You'd think I'd understand this concept eventually!

[Code]....

View 2 Replies

Actionscript 3 :: Child Added, But Not Displaying?

Feb 28, 2012

public class ItemView extends MovieClip {
private var _title:TextField;
private var _extra:MovieClip;

[Code]....

When I create an instance of ItemView and add it to the stage, "Title" displays but the blue square does not. However, if I make the graphics calls on this instead of _extra, I do see the blue square. This tells me that _extra itself is not displaying properly, but I can't figure out why. Is there some special procedure for adding one MovieClip to another?

View 2 Replies

ActionScript 3.0 :: RemovingChild IF Child Has Been Added

Feb 22, 2009

I have 4 functions called by their own buttons. Each function calls a movie clip from the library with addChild. When I click on one of these 4 functions I want it to remove the added children if any of the other functions had been clicked prior. Problem is, removeChild at the start of each function results in errors if a child had never been called yet. It's trying to remove something that isn't there. - So I tried making a 'flag:number = 0' for each of the 4 functions. Each function begins with settings its flag to '1' I put a for loop at the beginning of each function saying IF any of the flags are = to 1, then remove the children. I don't see why that should not work, I think the error lies in my array or my for loop if statement as I still don't fully understand them. So I will just post the code relating to the array and loop:

[Code]...

View 9 Replies

ActionScript 3.0 :: Error 1009 - Added A Pre-loader Frame To Scene?

Feb 13, 2010

I am a new Flash user (took the lynda.com Essentials training and building a website with Flash). As such, I followed pretty closely the directions I had written down to build a basic website with my bio, contact form, favorite links page. Until I can figure out how to make the pages in my book turn, I don't have any transition included. My website in html is [URL]..
 
the problem I am having seemed to happen when I added a pre-loader frame to my scene and now I can't get the error to go away even when I delete that slide and code.

[Code]...

View 1 Replies

ActionScript 3.0 :: Checking To See If A Child Has Been Added, Before Adding?

Oct 9, 2009

I'm working on building a gallery, but I've run into a slight snag. The full-size images are not all the same size, so they will overlap when loaded. In the showPicture function, is there a way for it to check to make sure there isn't a full-size image already loaded, and if there is, to remove it before adding the new one?

var imageLoader:Loader;var xml:XML;//parse XML data as an arrayvar xmlList:XMLList;var xmlLoader:URLLoader = new URLLoader();xmlLoader.load(new URLRequest("data/gallery.xml"));xmlLoader.addEventListener(Event.COMPLETE,

[code].....

View 2 Replies

ActionScript 3.0 :: Hittest Only Working With 1 Added Child

Mar 29, 2011

Ive got this piece of script where i place objects on the stage, to hittest eachother.Ive got two seperate addchilds: one child must hittest another child.[code]only one instance of the hitte_mc will hittest with the instances of Ring.

View 5 Replies

ActionScript 3.0 :: Check If Child Has Been Added To Stage?

Jan 22, 2009

Is it possible to check, using Javascript and without altering the ActionScript code at all, if a child has been added to the stage? I have in mind something like being able to call GetChildByName in Javascript, and if the child exists, call another javascript function.

View 0 Replies

ActionScript 3.0 :: Check To See When Child Has Been Added Before Adding?

Oct 9, 2009

I'm working on building a gallery, but I've run into a slight snag. The full-size images are not all the same size. In the showPicture function, is there a way for it to check to make sure there isn't an image already loaded, and if there is, to remove it before adding the new one? [code]...

View 9 Replies

ActionScript 3.0 :: Event On Item Being Added As A Child?

Feb 9, 2011

I have created a button class which has graphical elements. In future I might want to add this as a child to other things so what I would like to know is, firstly, can I get the details of the parent object from the child and, probably more importantly, is there an event that tells me when my button has been added as a child so that I can resize it?

View 2 Replies

ActionScript 3.0 :: Keep An Object Above Child That Is Being Added To Stage?

Jun 3, 2009

Is there a way to keep an object above a child that is being added to the stage?

Say I have a frame on the stage and I want to add different children to the stage, but want those children to fall under the frame that is already on the stage?

View 3 Replies

ActionScript 3.0 :: Call Event When Child Is Added To A MC?

Jun 8, 2009

Is there an event that is triggered when a new child is added to a MovieClip?[code]

View 5 Replies

ActionScript 3.0 :: Loader With Custom Properties?

Oct 15, 2009

Through searching the various forums I have found that Loaders are not dynamic and hence you can not apply custom properties to each instance of them. I miss the old way (as2 way of attachingMovieClip) that you load dynamic content, at least you can apply custom properties, and you can always reference them for each object.

What I'm trying to do is load a group of Images via XML. Each one of those images have a set of information that is associated with them (name, description, etc). I have the images loading in and positioning just fine, however when trying to have a tooltip show the name on Mouse Over, I'm not able to achieve this...

In short. I want to be able to store information for each item so that I can access it. Is there a way to do this in AS3 with a Loader or is there another route I can go? If I do this with Arrays, how do I store the Index of the specific item so I can use that in reference to the position in each array?

[Code]...

View 3 Replies

ActionScript 3.0 :: Access Loader Properties From Fla?

Mar 9, 2010

Let me just start by saying this forum is awesome, over the past 3 years I've found nearly all of the answers to my AS questions without posting once... That streak ends today.I'm building a site where the client is going to be able to upload various backgrounds which load depending on which tab they click on.

The class is BigBackground.as. It does the loading of the backgrounds, and then in the .fla I would like to manipulate these "BigBackgrounds" starting with the width. However, even though the width traces correctly from BigBackground.as, the width traces to 0 from the .fla file. I can access width from the class, but how can I access the width & height from the .fla?[code]...

View 2 Replies

Actionscript 3 :: Access Movieclip From A Child Added In Runtime?

Mar 28, 2011

I created a child that will be added on runtime. How do I access a movieclip on the mainstage from within the child?

View 1 Replies

Actionscript 3 :: Reference MovieClip After It Is Added To Stage As A Child

Nov 22, 2011

I am currently having problems referencing a MovieClip child which I add to the Stage from the Document Class. Basically when the MovieClip child is added to the Stage from the Document Class, I want a certain MovieClip already on the Stage to reference it once it is on the Stage.

Also, if it is possible, I don't want the MovieClip referencing the child being added to the Stage to have parameters linking it with the Document Class, because I plan on nesting this MovieClip within another MovieClip later on in the future.

Here is the code for the MovieClip class which is referencing the child once it is added to the Stage:

package com.gameEngine.assetHolders
{
import com.gameEngine.documentClass.*;
import com.gameEngine.assetHolders.*;

[Code].....

View 2 Replies

ActionScript 3.0 :: Stop A Symbol Added Child Resize?

Oct 19, 2011

I'm making a map editor in flash. For the map area, a dynamic Movieclip will this and that in it will be loaded into a movieclip area, but I realised the problem of how a symbol resizes when a child is too big in the symbol.

Is there ANYWAY to stop it from it from doing this, as I want a specific window for this where you can drag the map around to see the other areas.

View 1 Replies

Actionscript 3.0 :: RemoveChild Child Added In Loop Put In Array

Aug 18, 2009

I'm currently working on a system that loads images (by url flash gets from PHP).Now I've got a loop with addChild that works. I've put it into an array and I need a button with addeventlistener and then remove all the images in that array.[code]

View 2 Replies

ActionScript 3.0 :: AddChild Is Replacing Previously Added Child?

Jul 28, 2009

The code below is called after a thumbnail is generated and available. It is supposed to add the thumbnail to a MC along with the file name. The first go around (after a file is uploaded and converted) works, but the second time around the 2nd MC is generated and placed on stage with the correct file name and thumb image, but the first thumbnail image isappears (the file name stays).I don't understand why.

Code:
function initlistener(e:Event):void{
myURLFILE = "myURL";//reset URL

[code]......

View 2 Replies

Actionscript 3 :: Using Loader, Can't Access Properties Of Loaded Swf?

Apr 29, 2010

Main movieclip onstage is : design_mc. Within it is a movieclip already in place onstage with an instance name clipart_mc.also loading a ListBox to the stage and each time a selection is made from listbox myLoader9 is used to load selected .swf intodesign_mc.clipArt_mc.Now within each of the .swf files loaded into design_mc.clipArt_mc there is a mc ike to color transform called color_mc.So now the listbox is onstage and I make a selection that places heart.swf inside of design_mc.clipArt_mc. I want to access heart.swf so I did this:

var child:DisplayObject = myLoader9.content.contentLoaderInfo.content.color_mc;
var colorTrans3:ColorTransform = new ColorTransform();
var trans3:Transform = new Transform(child);

[code].....

View 2 Replies

Flash :: Inherited Properties Of An Image In The Loader

Aug 17, 2010

There's a Loader that I'm filling with different images depending on the button clicked. Now to keep it tidy I'm using the exact same loader. The problem is that no matter what I do to the image, the next image loaded always get's the properties of the previous one. I've used unload and the Loader returns 0 in width and height, and still the next image get's the previous image's w/h. Othe attempts have been separating it from the parent container and taking it out of the display list, and also using an Event.UNLOAD to make sure the previous image is out before the loading of the new image.

Script is gonne kinda long, but the basics would be these,

BrowserLoad.unload();
BrowserReq = new URLRequest("ImageB.jpg");
BrowserLoad.load(BrowserReq);

[Code]....

I guess it's general question: how can i be sure the image previously loaded in a Loader will not affect the next one coming? (its width and height being 0 has not been enough...)

View 2 Replies

ActionScript 3.0 :: Loader Instance With Custom Properties?

Oct 14, 2009

Through searching the various forums I have found that Loaders are not dynamic and hence you can not apply custom properties to each instance of them. I miss the old way (as2 way of attachingMovieClip) that you load dynamic content, at least you can apply custom properties, and you can always reference them for each object.What I'm trying to do is load a group of Images via XML. Each one of those images have a set of information that is associated with them (name, description, etc). I have the images loading in and positioning just fine, however when trying to have a tooltip show the name on Mouse Over, I'm not able to achieve this.

In short. I want to be able to store information for each item so that I can access it. Is there a way to do this in AS3 with a Loader or is there another route I can go? If I do this with Arrays, how do I store the Index of the specific item so I can use that in reference to the position in each array?** Should I use getChildIndex() in the function for the Event Listener to reference the data stored in the arrays for each item? If so, how do I do so? ***

PHP Code:
num = 0;var titleArray:new Array();function createImage(){ var thumb:Loader = new Loader; thumb.load(new URLRequest(url);

[code].....

View 2 Replies

ActionScript 3.0 :: Assign An External Class To A Newly Added Child?

Nov 21, 2010

Does anyone know how to assign an external class to a newly added child to the stage.

What I'm doing is using a button to pull in a Movie Clip from the library.[code]...

View 5 Replies

ActionScript 3.0 :: Event Listener To Detect A Child Added To The Stage?

Nov 21, 2009

What is the correct event listener to detect a child added to the stage? I tried:

[Code]...

which doesn't work. I also tried ADDED_TO_STAGE but that doesn't fire it either. Do you know the correct way to detect when the child is added? Perhaps I should be attaching the listener to the parent instead?

View 1 Replies

ActionScript 3.0 :: Can't Access The Parent Properties Of The Loader With Player 11.2?

Apr 13, 2012

this is so embaresing and my whole business is suffering from this[URL].. the key point in my TextArea class which extends TextField is to load external swf files and I use the .parent property of the Loader class to access the textfield... with the new security updates coming with 11.2 I cannot access the parent and the whole thing crashes to give you more insight:

imagine that we have file.swf being loaded into the project using the flash.display.Loader class. from the document class of file.swf, I can access the loader like this, all ok till here _loader = this.parent as Loader

[Code]...

every day that one of my clients updates their player to the new version, their website fails. I need to fix this a.s.a.p.

View 3 Replies







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