ActionScript 3.0 :: Multiple Buttons To Open Child Swfs Then Be Able To Close The Child From Within The Child?

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


Similar Posts:


Flex :: ViewStack.addChild Adding Multiple Child And Only The Last Child Is Visible?

Mar 10, 2010

var viewStack:ViewStack = new ViewStack();
viewStack.percentWidth = 100;
viewStack.percentHeight = 100;

[Code]....

Its only displaying canVas3 contents not canVas1 and canVas2

View 1 Replies

ActionScript 3.0 :: Swf With Mutliple Buttons To Load Child Swfs That Can't Get To Work?

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

ActionScript 3.0 :: Adding And Removing Child With Multiple Buttons?

Mar 30, 2010

I understand that the major difference between AS2 and AS3 is that in AS3 you have to put all your script in a separate layer, and unlike AS2 you can't add them to buttons or movie clips themselves on their respective layers.

I'm doing a project for school where I'm required to make a flash portfolio.

I have Five buttons, and right now, two of those buttons goes to a frame to display a picture. However, I've made the other buttons dynamic, and they call other swf files to show an image gallery, a game and another image viewer.

What I have a problem with is when I click the first dynamic button, and the swf if added to the parent movie clip, it does not leave the stage when another dynamic button is clicked.

So what I have is all the SWFs loaded on top of each other.

writing a code that will remove child for each button when ANY other button is clicked.

here is the code I have:

stop();
btn3.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndStop(3);

[Code].....

View 2 Replies

Flex :: SWFLoader - Child Apps Couldn't Access Certain Objects That Were Instantiated By Another Child App?

Aug 23, 2010

i have problem with swfLoader in flex, when i close following code in click method i can easly add many swf to main application

<mx:VBox id="content" width="100%" height="100%" ></mx:VBox>
public function doIT():void
{[code]....

when i close adding those swfs in loop i have the same error, it looks like child apps couldn't access certain objects that were instantiated by another child app, so what can i do?

View 1 Replies

ActionScript 3.0 :: Can't Swap Child For New Class Instance IF Child Is Exported For Action Script?

Aug 18, 2010

I have a movieClip with one frame on the timeline containing one child whose instance name is "myContent"I am using this function to swap "myContent" with any number of possible class instances.

Code:
function setContentAsClass(c:Class)
{

[code].....

View 2 Replies

ActionScript 3.0 :: Flash Selecting A Specific Child By Mouseclick, Turning Off A Child Within All Non Selected?

Mar 19, 2011

I've used this site as a resource leading up to this, not particularly sure if I worded this correctly I have a class "Block" which is just a square (will be something else later on in the process) I want each block to have controls to add an additional block in either direction so I have another class BlockButtons which has my buttons for each direction.

And another class GlobalVar where I keep all my variables for funsies

[Code]...

View 1 Replies

Flex :: Viewstack - Navigate To The Second Child During Onclick Of A Button Present In The Second Child?

May 10, 2010

I have a component mxml file in which i have a view stack, on click of a button i navigate to the first child, now i need to navigate to the second child during onclick of a button present in the second child. All the childs are component files included within the view stack. How could this be done, Sample code is present below,

[code]...

Now in my offering.mxml file if i try to access navigationViewStack i am getting an error stating 'Access of undefined property navigationViewStack.

View 3 Replies

ActionScript 3.0 :: Access Child Vars/functions Without Adding Code To Child?

Mar 11, 2010

I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine

View 2 Replies

Actionscript 3 :: Remove A Child At A Point - Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller

Dec 14, 2010

i'm new to AS3 and i was wondering what is the best way to remove a child at a point. i tried Holder.removeChild(Holder.getObjectsUnderPoint(new Point(exampleX, exampleY))[0]); however that returned ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

View 2 Replies

Child Of Child Movie Clip Are Null In Imported Object From Flex To Flash Right After Being Created?

Dec 16, 2010

I have an Movie Clip in Flash that have subobject of button type which has subobject of input text and movie clips. Right after creation core Moveclip all subobject are set to null, when I expect them to be valid objects.

[Code]...

MC_Core_design was created in Flash and exported to Actionscript. I've done this for button_1 class aswell. The code was written using Flex. When I comment out both lines that result in error I get correct view of the core Movie clip with all subobject. How can I set subobject properties right after object creation?

View 2 Replies

ActionScript 3.0 :: Parameter Child Must Be Non-null And DisplayObject Must Be A Child Of The Caller?

Jul 22, 2009

a quick low down would be its a gallery on the second frame and I breaks when coming back tot he first frame, all tweens die and such.

the errors are:

TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/removeChild()
at index_779_fla::MainTimeline/imageLoaded()

[code]....

View 1 Replies

ActionScript 3.0 :: DropTarget Parent Child - Removechild Won't Remove A Child

Aug 21, 2010

I have an issue where removechild won't infact remove a child. I think its something to do with my dropTarget.parent issues. The concept of the code is that you drag a source onto a destination. When you drop the source onto the destination you will get a text field that says "Hello" or "Goodbye". The objective i want to achive is that once i drop a source onto the destination, removechild will remove any previouse textfields added. This is proving difficult.

[Code].....

View 3 Replies

ActionScript 3.0 :: Removing Child (a Sprite) Containing (dynamic Textfield) Child?

May 12, 2010

I have created 2 sprites each containing a dynamic text field child. I then add this as a child of the stage. (I have done this in order to make the text clickable with a hand cursor on mouseover)It loads in fine, I just run into problems when trying to REMOVE it the sprite containing the text."ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller."Sections concerned in red:

Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;

[code]........

View 2 Replies

Professional :: Event Listener - Remove The Child (e.currentTarget) And Create A New Child In Its Place With The Next Line But It Doesn't Work

Feb 19, 2010

public function GlobalSolutions()
{
Navigation(' Home ', 'index', 235, 0x97F9EC);
Navigation(' Office Supplies ', 'Office_Supplies', 295, 0x97F9EC);

[code]....
 
I want to remove the appropriate child (e.currentTarget) and create a new child in its place with the next line, but it doesn't work. What do?

View 13 Replies

IDE :: Child SWF Close/unload Itself?

Nov 14, 2009

I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work.Here's my code for loading the child SWF from the parent's timeline:

var myrequest:URLRequest=new URLRequest("child.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);[code]...

What should I put in the child SWF to unload itself?

View 11 Replies

Actionscript 3 :: How Can A Loaded Child Swf 1 Communicate To Next Child Swf, Child Swf 2, Which Is Currently Not Loaded

Oct 14, 2011

I have a parent swf with three buttons: next button, back button, ticker on/off button.I have three child swfs, each with a ticker mc. When I click on ticker button on parent swfit dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y).

the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!

I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.

This is the code so far

"Next button"
go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
if (swf_no < (clips.length-1)) {

[code]....

View 1 Replies

ActionScript 3.0 :: Accessing A Child Inside A Child Inside A Child?

Nov 23, 2011

mHook -> mBottom -> hItemButton -> itemButton[a] -> itemButtonExp[a]

so i press another butoon, and retrieve a number 2, how do i access itemButton[2].itemButtonExp[2]? Coz i need to change the text field in there?

in AS2 i can access it directly by changing itemButtonExp[a].text, but how do i do it in AS3?

View 3 Replies

ActionScript 3.0 :: Passing Commands From Child To Child?

Aug 19, 2009

I have a main movie (main.swf). I load child1.swf and child2.swf into it with URLLoader. Is there any way to make a button to child1.swf which would take a user to some frame in timeline of child2.swf?
 
Something like
parent.child2.goToFrame(5);
 
I have tried different combinations without luck...

View 8 Replies

ActionScript 3.0 :: Remove All Child Of A Movieclip If No Of Child Are Not Known?

Aug 19, 2009

how to remove all child of a movieclip if no of child are not known

View 2 Replies

ActionScript 3.0 :: Calling Function From Child To Child?

Dec 9, 2010

I have a main.swf. I have loaded two child-SWFs into it, child1.swf and child2.swf.... There´s a videoclip inside child1.swf, can I stop that video from child2.swf?

View 2 Replies

Actionscript 3 :: Addchild Within Child And Clear The First Child?

May 25, 2010

Within the main timeline I have a menu, which is a MovieClip. This menu is comprised of about 17 "buttons", each of which point to a different section of the site. When a "button" is clicked (2 examples: menu_bag_button, menu_trashbag_button), the menu will animate, moving left, and 2 library items (bag_container and close_btn) should appear to the right, both within "framecontainer".Then, while the menu is on the left, this specific button must not repeat the menu animation, thus I did an if statement finding which frame it is on, and if it's on the left, it simply clears the framecontainer and loads the content again.

The problem is that when another link is clicked, it needs to do one of two things: if the menu is in the center with no content loaded, it needs to animate the menu to the right, and load the content/close_btn into "framecontainer"; or, if the menu is on the left, it needs to clear "framecontainer" and load the corresponding content.I've tried a lot of things but since all of these buttons are within "menu_mc", the actionscript has to point to the root, THEN to"framecontainer" and everything gets convoluted.Here is my current code. It functions fine, except for the fact that it doesn't clear content, so it continues loading the frames so that one is closed, there is still other content behind it:

import flash.display.*;
import fl.transitions.*;
import flash.events.MouseEvent;[code].............

View 1 Replies

Flex :: Can't Pass Data From Child To Child

Jun 25, 2010

I have a parent and 2 children. I am trying to pass data from child1 to child2 but keep getting an error message: 1061: Call to a possibly undefined method through a reference with a static type.

In child1 I have the following code:

[Bindable]
public var TestVar:String='sometext';

In child2 I am trying to get the value of TestVar and then use it as a value to search a mysql database via php.:

var newTestVar:String = child1.TestVar;
if(newTestVar != null){
getResult.token = someService.get_filtered_Paged(newTestVar);

[Code].....

View 4 Replies

ActionScript 3.0 :: Passing Values Child To Child?

Jul 8, 2009

I am a bit of a noob, and I'm having a problem. I had posted about this before but I think I was explaining what I need to do in way to much of a complicated manner so I'm going to try and simplify this a bit. I have 5 swf's.

- main.swf (parent)
- child01.swf
- child02.swf

[code]......

View 2 Replies

ActionScript 3.0 :: Add Child And Remove Child On Same Button

Sep 1, 2009

so I have a movieclip on the stage(lets call that selection movieclip) that once a button is clicked is going to open another movieclip(call this slideshow) I am trying to remove the selection movieclip when you launch the slideshow movieclip.

[Code]...

View 14 Replies

ActionScript 3.0 :: Access A Child Of A Child's Stage?

Jun 10, 2010

I have a mainSwf in which I load an external swf, which loads an external swf.( a child of a child). I am trying to set the framerate via AS3 for the childs child by using stage.frameRate= 15;

It doesnt work when the children are loaded into the mainSwf. how to access the stage of a child's child? I have tried root, Movieclip, this but can not get it to work

View 9 Replies

ActionScript 3.0 :: Remove First Child And Allow Only The Second Child To Show Up

Dec 14, 2011

this is the script i am using

[Code]...

the problem is that when i click on first button the Movie Clip does load ok but when i click on second button the first movie cliip is visible, i have try everything i have read here but no luck, i want to learn how to remove first child and allow only the second child to show up, i am looking forward to add more buttons so the remove child should be for multiple buttons, i am learning and so far did purchase a online tutorial but did not help me with this situation,

View 3 Replies

ActionScript 3.0 :: Child SWF Close / Unload Itself

Nov 14, 2009

Experience: I'm a newbie to AS3 - making the transition from AS2. Problem: I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work. Here's my code for loading the child SWF from the parent's timeline:

var myrequest:URLRequest=new URLRequest("child.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);
myloader.contentLoaderInfo.addEventListener(Event. COMPLETE, movieLoaded);
[Code]...

What should I put in the child SWF to unload itself? Apologies if this presumably simple task has been covered, please point me to the thread.

View 5 Replies

ActionScript 3.0 :: Close Button - DisplayObject Must Be Child Of Caller

May 8, 2010

I'm receiving this as an output error, when trying to use a "close button" I created for a lightbox that tweens in after the user clicks all_1thumb:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at testportfolio_fla::All_mc_2/closePop().

The lightbox populates with the correct image but the close button doesn't. Here is the entire script:
import fl.transitions.Tween;import fl.transitions.easing.*;
//Portfolio SubnavArt_btn.addEventListener(MouseEvent.CLICK, goViewAll);
function goViewAll(event:MouseEvent){
(this.parent as MovieClip).gotoAndStop("Art")}
[Code] .....

View 1 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width / Height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.

View 10 Replies







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