ActionScript 3.0 :: Killing Child On Loading New Swfs?
May 15, 2010
I'm confused on the parent/child thing. Seems like the "child" statement would refer to the file I'm loading, not the file I'm in? I want the file I'm IN to kill ITSELF when it loads the next swf (it's child?)And then there are other times when I want them to stack one on top of the other. I've added comments above each set of button code to explain./This code is in home swf. Handles portfolio buttons. I do not want to unload Home.swf, so this works fine.
scene1.addEventListener(MouseEvent.CLICK, myRequest);
scene2.addEventListener(MouseEvent.CLICK, myRequest);
scene3.addEventListener(MouseEvent.CLICK, myRequest);[code]...............................................
View 1 Replies
Similar Posts:
Sep 20, 2010
I've got several objects on a stage, each is an instance of a different class. Inside each of those classes is a timer, set to loop (basically refresh) every 5 seconds.Even after removing the instance from the stage and setting it to null, the timers continue in the background. Is there some way I can stop and remove all the timers with an object when I null it, or do I have to do that manually before removing the object?
View 7 Replies
Mar 25, 2009
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
View 2 Replies
Apr 23, 2012
I have One SWF loading Two External SWFs seprately that have dataGrid components in them. The Externals load and run fine on their own but when I try to load them into CORE SWF I get ....
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()[code]..............
View 2 Replies
Sep 11, 2009
I have a main fla file which loads an external swf into an empty movieclip on the main timeline which works fine but I want a button in the external swf to load another external swf into another empty movie clip on the main timeline.eg. start.swf loads UKEIAMap.swf into (empty movie clip within start.swf) MapLoader_mc then a button havant_b within UKEIAMap.swf needs to load HavantProjectSheet.swf into (empty movie clip within start.swf) ProjectSheetLoader_mc without unloading UKEIAMap.swf
View 3 Replies
Aug 2, 2006
Flash - 8 : Above is an example of what I would like to do/have done. I've gotten as far as loading the "loaded.swf" into the "start.swf" but my problem is I'd love to use that little loading action I made earlier without copying and pasting into the new movie the same actions for a different link. So, how do I load "loaded2.swf" into "loaded.swf" via the link in "loaded.swf"?
View 1 Replies
Jun 8, 2009
I'm designing a battery of online psychological tests. Each test is created on its own swf file. What I need is help coding a main parent file that will load and unload each of these child swfs in sequence.So, when the main site is first visited, the parent loads "test1.swf" as a child swf. Then, when the user clicks a "finished" button in the "test1.swf" child, the parent unloads "test1.swf" and loads "test2.swf". An important point is that the child must be unloaded completely, as we're dealing with large video files that can't remain in the active memory without causing problems.
View 2 Replies
Apr 16, 2007
I have a parent swf that loads 5 child swfs.Everything loads fine but after the xml loads the data there is no functionality on the child swfs other than the listen command to use the left and right keys to switch between images. The scrolling and buttons on the child swf become deactivated.
I THINK I've traced the problem to the activateButtons() function. I've tried modifying it with no luck.If I comment out the function then the child swf works and the parent swf doesn't.Again, this is only an assumption,not conclusive.Both swfs work fully independantly. Only some functions of the child swf work loaded into the parent swf.I got the code for the parent swf online and I can't even remember where, but here it is (modified):
Code:
makeButtons();
import mx.transitions.Tween;[code]....
View 12 Replies
Aug 5, 2011
When I try loading 2 swfs that use a local connection to communicate I get this error
ActionScript Code:
SecurityError: Error #2070: Security sandbox violation: caller file:///C:/Users/Siggy2xc/Adobe Flash Builder 4.5/Mass Media CG/bin-debug/swf/controlPanels/animation/Test.swf cannot access Stage owned by app:/Mass_Media_CG.swf.
[Code].....
How can I allow the 2 swfs using a local connection to communicate?
View 0 Replies
Jan 18, 2011
Is there a way I can share sound assets between parent and child swfs?
Currently, I have a parent swf that loads a child swf (and each have preloaders) and some of them have the same sound assets. I would rather only load the sounds once... can I reference a sound even if it 'lives' in another swf?
View 1 Replies
Dec 20, 2011
I have a project which has a main swf file that is compiled with a bunch of classes. The main swf also loads in other child swf objects, created in the flash IDE, that happen to reference some of the same classes.
It seems redundant to have the child swfs include the main swfs classes, especially if I update the classes which means I have to recompile all the child swfs, not just the main swf.
Im using FlashDevelop 4.0 RC3 with Flex 4.6/AIR 3.1 to code the main swf, and the child swfs are flas made in CS5.
I was thinking of using SWC's, but I'm not sure how to incorporate that into FlashDevelops workflow. I tried the SWC export plugin but that doesnt seem to work very well, it attempts to export everything in the project and doesnt seem to offer me an option to be specific...
Surely there is a way to compile flas from the IDE and allow for classes to be used for compile type checking etc, but not actually include them in the compiled swf? I know with the flex command line compiler you can generate a link-report xml from the main swf then use that xml file to exlude classes from the compile of the child swfs, but I cant see how to do something like that when exporting swfs from the flash IDE.
View 7 Replies
Jun 25, 2010
Following is my code of base class :
Code:
public class Application extends Sprite
{
[code].....
View 6 Replies
Apr 29, 2010
I am building an interface that loads swfs externally into an array(pre-loader) my code places these swfs into a container movie clip on stage when called.I am trying to access the swf that is now a child of the movie clip so i can rewind, pause, and play the swf.Currently they are loading in just fine, but my code isn't able to touch the swf. The swfs also play all the way through when they are loaded so when i change to the next one of the sequence my swf is already at its end frame.
Here is the code:
Actionscript Code:
stop();//Variable creation-----------------------------------------------------------------var _swfLoader:Loader;var _swfRequest:URLRequest;//creates an array with all the swfs locations inside--------------------------------var _swfPathArr:Array = new
[code]....
View 9 Replies
Sep 14, 2010
Imagine the following setup. The main swf loads a child swf.In AS2 i would simply use _parent or _root to call the desired function. How can that be done in AS3?Can this still be done? Can I call a function on the main swf from the loaded one? How about the other way around, this time, from main to loaded swf?
View 1 Replies
Apr 29, 2010
I am currently building an interface that loads externally loaded swfs into a movie clip on stage. I have no problem loading them in and switching between them. I am, however, having an issue accessing the swf, so that i can rewind, pause, and play the loaded swf.
Here is the code:
ActionScript Code:
stop();
//Variable creation-----------------------------------------------------------------
var _swfLoader:Loader;
[Code].....
View 5 Replies
Mar 26, 2009
here is the scenario..I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. I found this code in someone's post and I am trying to modify it so that works for multiple buttons ...it currently works for a button loading a single swf. The name of the instance name of the buttons is the same as the name of the swf file that they load so I thought I could do something that when the button is clicked it would pass the name of the button into the URLRequest but I can't figure it out. Here is the code I am using.
////////////////////////////////// code from the actions layer
var bioloader:Loader;
var biocontainer:MovieClip;
[code]......
View 2 Replies
Aug 13, 2010
I am loading multiple .swfs into multiple .swfs, but the .swf are never being properly unloaded. I thought they were unloading until I started monitoring my Page File Usage and seeing it increase everytime I loaded another external swf.
In using this function to load my content, what would be the proper way/function to unload the content?
[Code]...
View 2 Replies
Apr 29, 2011
I've got this interactive poem I've been working on for a class. I've basically finished each "episode" seperately. I made a parent document which essentially loads one of the ten child documents onto the respective key frame. Here's a sample of the code for the first key frame of the parent document:
stop();
import flash.net.URLRequest;
import flash.display.MovieClip;
import flash.events.Event;
stage.addEventListener(Event.ENTER_FRAME, LoadSWF2);
[Code]....
Well Two things are messed up about it, well my "ChildTimeline2" variable will off and on assosciate itslef not with the main time line of a child document, but of a nested symbol inside said child document. Even worse, the "gotoAndStop();" command I will give sometimes applies to Parent document... yaay! but often it will apply to the child document. The end result being this horrible looping moment where you are stuck in one child document for all time.
I wish I could attach the documents but they exceed the 300KB. how I can get Actionscript to listen fro the last frame of the maintimeline of the child document, or tell flash to gotoandStop for the parent document
View 4 Replies
Jul 5, 2005
i have buttons in my library.url...into it when i edit it from the library but it always says "current selections can't have actions applied to it". How do i get to it so i can have a link pop up when i click the button? does the "getURL" also work for files on my computer? for instance i want to click a button and have a movie pop up from one of my folders on the c drive.
View 8 Replies
Jan 23, 2009
deleting, killing objects and functions. There seem to be a few different ways to achieve to completely get rid of unwanted objects and functions(which are in turn objects as well, no?)
Just to refresh:
objects:
Code:
object = undefined // does the job
object = null // does the job
exception: if the object is referenced anywhere else in the application, the object is still in memory, unless the object's reference is killed as above. also: if you attempt to try cleaning up and object , which has objects itself, (e.g. object.subObject = new Object()), then those subObjects are still alive.
To properly clean up the object with subObjects, the subObjects have to be killed off seperately.
[Code]...
View 1 Replies
Sep 2, 2009
I have an MC(named "mouseTip") that gets added to the stage and follows my mouse on MOUSE_OVER. On MOUSE_OUT it gets removed. I just created a dynamic text field inside mouseTip so I can display type when mouseTip is present. For some reason, when that happens the mouse gets blocked by the textfield inside mouseTip and the MOUSE_OUT gets triggered.Once mouseTip is removed, the MOUSE_OVER gets triggered since the mouse is still over the button and my mouseTip MC just flickers rapidly.
View 5 Replies
Oct 18, 2004
i have some drop downs that i am trying to create but when i add some actionscript on (rollover) {stuff} it kills the over state of the button.I can add actionscript to a button and still have its over state show
View 3 Replies
Mar 1, 2005
When i run this swf for a while, the CPU reaches 100% and my computer get locked. I guess it has to do with enterFrame, but are not sure.
[Code]...
View 2 Replies
Nov 23, 2009
Using Flash 9.0 on Mac. Have externally loaded images as slideshow in swfs embedded in dreamweaver. The swfs load time after time in Firefox PC and Safari PC but only on the first try in IE7. Have not been able to test IE8 yet. [code]...
View 6 Replies
Feb 1, 2012
I have a SWF that contains 3 spaces for banners on a 'My Account' page. Initially they all showed the same banners to all customers but now we segment customers and that means each banner can have numerous variations. This has caused the SWF to be massive (over half a meg) for something we aim to have 80-100 Kb.
I believe the solution is to have the current 'main' SWF be a place-holder that decides what segment the customer is in for each banner then pull another SWF file from the server - so only the banner being displayed is the one being downloaded.I cannot find AS to download externally hosted SWFs...
View 6 Replies
Apr 9, 2009
The three buttons on the stage all load remote SWFs into the same location ... Each succesive button that is pressed is supposed to load a movie that takes the place of the one that is currently thereThe problem is, each button click merely loads it's movie underneath the existing one ... so they just keep stacking up on top of one another. I need a way for the code to check if a movie is loaded, and if so, unload that one first before it loads the current one I though an "if" statement could check to see if the "swfLoader" instance is fully loaded, and then if it is, it would know to remove child I know there must be a more efficient way to see if anything is on the stage
stop();
unit13_3br2ba.addEventListener(MouseEvent.CLICK, getUnitSWF);unit21_2bdStudy2ba.addEventListener(MouseEvent.CLICK,
[code]....
View 6 Replies
Feb 23, 2008
1) I made a german and an english swf-file, each of them containing the entire website. These two you catch from the main index-file, which is only a txt showing "german" and "english". When you click one of them, you load one of these two swfs.It takes some time, because the swfs contains a lot of heavy images which are glued to the swf. Ill get back to that loading swfs later...
2) inside each of these two swfs I made some PHPfunctions. One is a guestbook, the other is a form, where you send personal info (4 boxes, single-line) + a message in multiline to my email through PHP.When I publish the swfs individually and one at the time WITHOUT the main index (english/german) which loads the swfs it works almost fine. The input txt boxes appear on the screen, and you can type in the boxes. When I recieve this email through PHP, it up a bit. There is no space between " message" and "apartment of choice", its all one long line. Apart from that, it works...
However, when I load the swfs using the "main index file" with the german/english choice, the input boxes doesnt even SHOW on the screen. Only the txt telling you where to write what. The txt-curser shows, though, and you are aware, you should write something here, but you write using WHITE txt. When you click "send" in the GuestBook, the email looks good, the message is there, but writing the message on the website, you dont see what you write, because it white!
QUESTION:How do I load external swf-files ( not only images, but entire files, that itself is told to load other swfs) into a main, so that the PHP inside these swfs are working properly? If I am to write some script inside the indexs ASRunActiveContent, where do I write it?
View 1 Replies
Jun 17, 2010
I am facing a issue in Flash container. I am having a project which has main container which call different SWFs into it. Now I call this main container file into another container, and their problem starts. Many option doesn't work properly which generally have _root, _parent etc...
If I want to run project (main container SWF and child SWFs) into another container file which place on a website. I want to show whole project from this container file so what I need to do?
View 1 Replies
Mar 21, 2009
I've attached the FLA.I'm trying to make a game where the guy kills rats that appear randomly as the scenery moves down, however every time I shoot the rat and remove the rat child, it throws an error that my actionscript is pointing to an inexistent rat. Hence my problem... is there a way to add many instances of the same class with AS3 at random intervals and remove them when it's shot with the bullet???
View 10 Replies
Mar 1, 2011
A user is reporting that a certain screen of our Flex app times out in Google Chrome and IE. I can reproduce this problem, but I don't know what is causing it. I cannot reproduce it with Firefox.
I was wondering if there is a way to temporarily disable this feature in Chrome because I know that in Firefox(at least in v3.6) when a Flex/Flash app executes for too long I get a stack trace from the Flash runtime pointing me to the problem. example:
Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at TimeoutTest/___TimeoutTest_Button1_click()[/TimeoutTest/src/TimeoutTest.mxml:5]
I think that Chrome is hijacking this process and denying me that information, so I would prefer to prevent this behavior for now to see if the runtime will detect the timeout and provide a similar trace.
View 2 Replies