ActionScript 3.0 :: Loosing Listeners When Reparenting Childs?
May 16, 2010
Recently noticed this, if i add an event listener somePerent.target.addEvent() and then move that target to someOtherParent.addChild(somePerent.target) the listener is lost, is there a way to avoid it?
View 3 Replies
Similar Posts:
Jan 11, 2009
how to go about reparenting a movie clip that is already on the stage? I can only seem to find how to reparent sprites or children that were added. I'm working on a paper doll sort of game for a class [URL] you can sort of get an idea from it here.
Code:
package
{
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
[code]....
View 13 Replies
Feb 13, 2010
I am new to flash & working on my first swf file for a website.Problem is I loose image quality after publishing & uploading to the website.Ive located the publish setting for jpegs & changed this to 100% but problem still exists.When I do publish preview with the flash program it looks fine.
View 10 Replies
Oct 20, 2008
I remember i realised this ages ago, but never really needed anything with it till now. I think it was after flash mx that imported images, when rotated or scaled loose quality horribly.
View 1 Replies
Jan 21, 2009
I am using a scrollPane component. We all know they have the binding box and drop shadow. I managed to loose all that with this:
Code: Select allmyScrollPane.setStyle("borderColor","0xFFFFFF");
myScrollPane.setStyle("shadowColor","0xFFFFFF");
myScrollPane.setStyle("highlightColor","0xFFFFFF");
[code].....
View 1 Replies
Apr 18, 2007
I have this menu_mc appearing on stage on RollOver.Inside this menu_mc are 5 other mcs that are also supposed to react on rollOver.But : the rollOver works only on the menu_mc, the rollOver on the nested mcs no. I put all the script on the main stage, accessing my nested mcs with the "insert target path".I tried also to put the script of the nested mcs inside the menu_mc movie clip, but it does not respond.What do I do wrong ?
import mx.transitions.Tween;
import mx.transitions.easing.*;
orig = Menu_mc._x;[code].....
View 4 Replies
Jan 26, 2011
I have an image that is pretty high resolution and looks fine in Photoshop CS5. However, whenever I try to paste it into Flash CS5, it looses quality and looks terrible.If I try to save it as another image format first and then import it into Flash, the color changes
View 4 Replies
Feb 18, 2009
I have a big image 676 * 340 dimensions and I want to re size the same image down to 200* 150 without destroying quality does any one know a way of achieving this.
View 1 Replies
Jul 24, 2004
I have two components in my movie,how to write out the code for the listeners.Is it possible to write one listener that listens for changes in both components or do I have to write a separate listener for each? How would this look like written out?
View 1 Replies
May 20, 2010
Loosing FMS connection after 2 or 3 execution of the program. Y ?
View 3 Replies
Apr 26, 2010
I am using foll0wing code to fetch data from XML file to flash.
Code:
function xmlLoad(fileName:String){
var pagedata:XML = new XML();
pagedata.ignoreWhite = true;
[Code]....
The problem I am encountering is that when I call function "createVar()" it looses the stage reference and "pagedata", my xml object.
View 0 Replies
May 31, 2009
I'm trying to develope a texteditor for my websites in As3, but I'm facing a issue, I can make my selected text bold, italic, untherline etc, I can insert a link, to an email, per example, but if I try to insert more than one email link, my textarea looses all previously inserted bolds, italics, etc, even all the line breacks are gone.
What can I do to avoid this, this is the piece of code to make an email link
[Code]...
View 7 Replies
May 30, 2011
I do have a xml and i am having that content in an array using xpath. It was working fine. But in the rare case, i am loosing the content from last 7 or 6 or 5 or 4 or 3 or 2 or 1 index values. I couldn't able to find what exactly the problem was. once again if i replace the original xml and when i open it, it was fine.
View 5 Replies
Feb 13, 2010
I am playing with papervision and is creating a carousel. For that I have used a tutorial on [url].., and hey - It works just fine.
But, i want to add the carousel within a holder(movieclip), so i have created a movieclip, placed it on the stage, and given it an instance name. Also, i have exported it for actionscript.
So, now instead of doing scene.addChild(plane); i tried to do planeHolder.addChild(plane); and that did not work out too well.
View 1 Replies
Mar 27, 2011
I'm working on a game that lets objects of the same name spawn everytime the timer triggers (Which is every 5 seconds). The objects that spawn on the stage get pushed into an array, so I can let them each fall down by using the ENTER_FRAME function. Here's a piece of the code:
Code:
timer = new Timer(5000, 6);
timer.start();
timer.addEventListener(TimerEvent.TIMER, onTime);
[code]....
View 1 Replies
May 30, 2010
I have been busy working on a small mini game, in which has several other mini games such as Memory. The script itself is working fine and the game works as it should but the problem with it is, whenever I decide to go to a new frame (and end the game before someone has really found all the answers) the cards stay, so they are visible on the other frames aswell.
Now I have been trying to remove all the childs whenever its on a new frame but I just can't get it to work, I hope someone on the Flashkit forums is able to help me out with this.
Below is the script I am using:
Actionscript Code:
import away3d.cameras.*;import away3d.containers.*;import away3d.materials.*;import away3d.primitives.Planeimport away3d.primitives.Cubeimport away3d.containers.ObjectContainer3D;import
[Code].....
View 6 Replies
Mar 29, 2010
I have 6 movieClips on stage. When I roll over any one of them, I want to:A) removeChild the remaining 5 movieClips and then B) bring a new movieClip onto stage that would hold a description and possible button links
Upon rollOut, I want to fire a 3 second delay, removeChild the description movieClip and then addChild the original 5 (removed) movieClips.
[Code]...
View 11 Replies
Oct 24, 2010
add childs to canvas. I want to add childs to canvas in top-down direction and left-right direction? I'm using the addChild function but I don't want to calculate the X and the Y for each Item. is there a way to do that?
View 1 Replies
Apr 27, 2010
I have a portfolio gallery that I can browse. I click on a thumb and it opens an image. Then, if I want, I can "zoom it", by loading a larger image, that is not necessary equal.At the first time I "zoom" an image it all looks fine. I create a black rectangle, a loader and add them to stage covering everything.When I'm done seeing the image, I click on any off them and supposelly they are removed. They even desappear from stage.
But when I try again with a diferent image the same code, it actually loads the previous image and square, plus the nem desired items.This errors increments everytime I click and zoom. All of the previous appear and I have to close them again.
ActionScript Code:
portfolio_mc.aberto.botaoZoom.addEventListener(MouseEvent.CLICK, ZoomFuncImg)
function ZoomFuncImg(event:MouseEvent)
{
[code]...
View 2 Replies
Apr 10, 2011
I have this problem: I am making a game with flash cs5, and i am coding in as3 i have written some code, that spawns an child (a fireball) from the character position. i made a movieclip symbol on my main scene, that mc is the "parent" for all the enemies that i am adding but now i need to detect the collision between an enemy child and a fireball child, does anybody know how to do that? if asked i can post some parts of my code
View 2 Replies
Jun 16, 2011
how can I access to All instances of a movieclip in the stage with for example a for loop?
View 3 Replies
Aug 24, 2010
I want my document to get a childs rotation.
View 6 Replies
Oct 5, 2008
I have this code:
stage.addChild(m1);
stage.addChild(m2);
stage.addChild(m3);
for each (var j:MovieClip in stage) {
trace(j.name);
[Code]...
View 3 Replies
Mar 30, 2012
I have an ArrayCollection which has several employees and departments.Each employee belongs to one department. How can I find out how many employees are belonging to the same department from the said ArrayCollection.In database we use join query to do this, but how can I do this by using an ArrayCollection in Flex?
For Example
[code]...
How can i fetch these values from arraycollection in flex? is there in inbuild function or property provided by adobe.
View 4 Replies
Sep 24, 2009
Creating an application for a client and figured now is a better time than any to make the jump from as2 to as3. I've read many articles and books to keep up to speed but I get constant errors everytime I add or change something. Its becoming beyond ridiculous and rather than searching another unrelated google result, I thought I'd post something here.
[Code]...
View 1 Replies
Nov 15, 2009
Image's paths are in the xml file. I make a loop to load images to the Display List.
So if i have a loop:
ActionScript Code:
for(var i:int=0;i<xmlList.length();i++)[code]....
after it is done i would have access only to the last imageLoader instance. How to get access to the rest of images, which were added to the Display List with the same name "imageLoader".I tried to call it with the imageLoader.name property,but surely i do something wrong, as only errors appear in the output panel.
View 1 Replies
Nov 22, 2010
I've got a MovieClip which has bitmaps pasted onto it via AS3. These bitmaps are transformed and are sometimes over each others with transparency.So I would like to the grab the whole MovieClip as it is and make it a completely new bitmap. Problem is:
ActionScript Code:
bitmapData.draw(mc) //does NOT work in this case (nothing shows)
bitmapData.draw(mc.getChildAt(0)) // works, but it doesn't save the childs properties such as x,y coordinates and transparency
What I need is basicly a function such as "Image -> Apply Image" in photoshop.Except that it only copies a movieclip and not whole stage.
View 4 Replies
Feb 28, 2003
how can i make all mcs (a bunch of them) inside another mc, to gotoAndPlay in a random frame without having to adress each one of them by theyr instance names?
wild guess: a for loop?
View 10 Replies
Aug 14, 2008
I have problem with clearing memory in my game because of eventListeners, garbage collector not clear my objects with events, because events points them when objects are removed from scene. Is there any way to clear events connected to object and his childs? (game create a lot of objects and put diferent listeners if necessary, but because there are also libraries which are created by other programmers I cant just make list of events to clear) Even clar whole scene will be sutable for me if it will destroy all events, because its big problem and game close to beta -.- the only thing I cant do is close flash window
View 5 Replies
Jun 19, 2009
I have a huge doubt about controlling childs with external movies.. For example:
[Code]...
How manage the external movies if they have a eventListener in a button like
[Code]...
View 1 Replies