Professional :: Target Root From A Loaded Swf?
Feb 5, 2010
I have a swf called anim1.swf acting as a preloder and loading anim2.swf. anim1.swf is attached to a document class called Racine.as. Once anim2.swf is loaded, how can I target the root of anim2.swf?
For example, anim2.swf contains 2 clips called clip1 and clip2. clip1 contains a child called clip1_1. How can I access clip2 from within clip1_1 by using an absolute way (I don't want to use the parent property)?
N.B : a way would be to have a document class attached to anim2.swf, but here there is none.
View 5 Replies
Similar Posts:
Mar 22, 2010
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 Replies
Feb 24, 2005
I have a movie clip embedded in a scroll pane on level 2 of a multi-.swf project. I am trying to target the root movie to load another .swf (a video player window) from buttons inside the embedded MC. the buttons work on the external .swf but not when loaded onto the main timeline.[code]
View 2 Replies
Jul 13, 2009
I want to find out the value of an index of an Array defined on the main timeline, from within a MC on the stage. In AS2.0 this would be as simple as trace(_root.mk_contArray[0]). In AS3.0, naturally something like trace(root.mk_contArray[0]) just doesn't work, nor any other variation I've tried. Is it something to do with addChild()? This instance is named, but I haven't used that method.
View 3 Replies
Feb 24, 2005
I have a movie clip embedded in a scroll pane on level 2 of a multi-.swf project. I am trying to target the root movie to load another .swf (a video player window) from buttons inside the embedded MC. the buttons work on the external .swf but not when loaded onto the main timeline.i have tried on the button itself:
on (release) {
_root._root.loadMovieNum ("vidPlayer.swf", 4);
}
[code].....
View 2 Replies
Oct 1, 2009
I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline.[code]...
View 3 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf. In AS 2.0 i simply used "_root.gotoAndPlay(frame number); I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 1 Replies
Mar 4, 2012
I have a SWf application built in flex 4. One part of the application relies on accessing a public variable ("step1") set at the application root, and is accessed with
var app:Object = FlexGlobals.topLevelApplication;
trace("step one is "+app.step1);
This, while not optimal, has worked fine. Now, hoever, I need to load this entire application into another application, and I can't figure out how to access my step1 variable any longer.I have been loading the swf into the new parent application like so:
public var myLoader:Loader = new Loader();
public var pizzaContainer:UIComponent = new UIComponent();
private var myUrl:URLRequest = new URLRequest("chickensoup.swf");
[code]......
View 1 Replies
Aug 5, 2008
I was checking my policyfiles log file and noticed that I have the following for a newly created (and played in Firefox) SWF file I made:OK: Root-level SWF loaded:URL...I was trying to find some documentation in livedocs.adobe.com but couldn't find anything...
View 1 Replies
Nov 24, 2009
Is it possible to tell an externally loaded swf what its root is?
These swf's I want to load in:
main.swf --> manager/g1/viewer.swf
In the main.swf I want to tell the viewer.swf:
your root = ../manager/g1/
So the viewer.swf can read the external xml and images from its own root. (../manager/g1/)
View 0 Replies
Mar 25, 2011
Ive a quick question on using root property when swf's are loaded in other swf's. Is it safe/wise to reference MovieClip(this.root) in packages/classes if the swf will be loaded and placed inside another swf? I read once that root will always refer to maintimeline, and all objects have the same root. So...will the root change in some way if a preloader loads the main swf?
View 5 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf.In AS 2.0 i simply used "_root.gotoAndPlay(frame number);I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 3 Replies
Jul 26, 2010
Can I control my main timeline with an externally loaded swf?
View 9 Replies
Oct 17, 2007
I am forced to develop in AS2 for Flash Player 6 with dial-up speeds in mind (client imposed limitations - dark scary limitations *shudders*).The client requires a swf to load into a flash application dynamically.I am worried about this 'cos there are a number of _root objects, movieclips, initiated classes and variables at the _root level.I don't want the client to be able to load in the external swf with code referencing the _root that could potentially interfere with my _root items (potentially exploding my universe!).Is there a way to change the scope of _root and _level0 for the target mc the swf is loaded into?Can I simply disable _root and _level0 for this clip?I would prefer a non-class method to achieve this if possible as I am loading all class scripts at frame 2 and all shared library elements, xml and the offending swf in frame 1 - all for accurate preloading purposes (that whole dial-up thing again ....)
View 2 Replies
Dec 12, 2009
I'm loading a lightbox as an image gallery, but I'm working on changing it to full flash. My site is structured with external swfs. I ran into a barrier, because I'll need to load the images (and reference the stage size) in the root timeline, but I don't know how. MovieClip(root) only references the smaller loaded swf's main timeline.
View 1 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf.
In AS 2.0 i simply used "_root.gotoAndPlay(frame number);
I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 1 Replies
Oct 20, 2010
How can I access variables defined on root from a loaded movieclip? The loaded movieclip path can differ, so I cannot get to root like parent.parent, for example. I thought something like this.root.varName may work, but it obviously doesn't.
View 3 Replies
May 13, 2011
Does anyone know the best method to trigger a function in the root from a dynamically loaded movieclip (loaded using addchild) using AS3, I understand targeting root is not the best way to do this?
View 2 Replies
Feb 12, 2011
I'm using a PreLoader as a parent SWF that loads the actual website as a child SWF. In the website SWF, the child SWF, will MovieClip(root) still work and refer to it's own root, or the PreLoader's root? And would I still access the websitite's document class (the child's document class), through MovieClip(root)? What if both files have a document class?So my main question is how do document classes and MovieClip(root) behave in the scenario when you have:
Parent SWF - document class, MovieClip(root)
|
Child SWF (loaded by parent) - document class, MovieClip(root)
View 2 Replies
Jan 26, 2010
Im having whta I think is a quite common problem. I recently started migrating form AS2 to AS3 and Im buidling a home made template for all AS3 projects..
I have just loaded portfolio.swf on top of main.sfw. The buttons on portfolio.swf share the same class as the buttons on main.swf
This is the button class:
Code:
package com{
import flash.display.*;
import flash.events.*;
[Code]....
View 9 Replies
Jul 10, 2007
Short version: I'm trying to load an external .swf from a URL and add event handlers to the movie clips (or it's movie clips sub-MCs) on its stage. I can't find a THING online on how to do this.Details:I've been tasked by my employer to build a simple control interface in flash, with just a few buttons to do things like display some info or images or maybe an associated MP3. I've written little test apps to do all of these individual things & managed to fake my way through.But the sticking point is that I'm now trying to place all the UI controls into an external .swf, which I then load into the canvas by a URL. The goal is to be able to load it into a variable named, say, 'private _ui:MovieClip' and then add event handlers to mivie clips within that bynamelike:_ui.someButton1.addEventListener(MouseEvent.MOUSE_ UP,handlerFunction1);_ui.controlStrip.someButton2.addEventListener(Mous eEvent.MOUSE_UP,handlerFunction2);The goal is that if we want to swap out the UI for a particular client, we just export a new .swf with all the correctly named MC instances & use the new URL to load the UI.I seem to be able to load the .swf OK and trace the movie clips "Main Timeline" like so:
_ui2.contentLoaderInfo.addEventListener(Event.COMP LETE , uiDidLoad);
function uiDidLoad(evt:Event){
trace("UI2 LOADED");
[code].....
View 14 Replies
Jul 15, 2010
I have small issue in as3. I am load "mainmenu.swf" file into "main.swf". through loader class. so now "main.swf" is parent "mainmenu.swf" file children how can call "main.swf " variable & function from "mainmenu.swf" .
View 2 Replies
Jan 26, 2007
I'm loading a swf into a container clip and I'd like to target this swf for control such as gotoAndPlay, etc.
I thought targeting the container clip would do it but it's not. Here's my script so far:
var mediaMenu:MovieClip = this.createEmptyMovieClip("mediaMenuHolder", 1);
mediaMenu._x = 15;
mediaMenu._y = 175;
var mediaMenuLoader:MovieClipLoader = new MovieClipLoader();
mediaMenuLoader.loadClip("mediaMenu.swf", "mediaMenuHolder");
this.mediaMenuHolder.gotoAndPlay(2);
The swf is loading but I can't seem to give it any instructions.
View 2 Replies
May 30, 2009
Can someone help me out and tell me how i can set the size of an external swf i have loaded into a target movieclip.ive got the external swf loading into the target ok but its too big.
View 3 Replies
Jun 15, 2009
i have creating an image gallery of sorts. I have loaded my thumbnails through an xml like so:
Code:
function loadThumbs(){
for (var i = 0; i < totalElements; i++){
var thumb_url = elements[i].@thumbSrc;
trace("totalElements: " + totalElements);
[code]....
now i want to have it so that when u click a thumb, it re-layers them. I am able to get the one u click to the front of the order, but how can i tell the others to layer as i want? I guess the problem is that I cannot use the name of the display object and i can't user image_loader to setChildIndex with.
Code:
function replaceElementAndMoveThumb(event:MouseEvent):void{
setChildIndex(event.currentTarget, numChildren - 1);
trace(event.currentTarget);
}
I am thinking that in AS2 I would use the movieclip instance name, but don't think this works in AS3.
View 2 Replies
Oct 1, 2010
I'm trying to somehow target a MC being loaded into an empty container MC. I've tried everything I could think of.
Basically, I'm making a movie editor. Right now clips are added to the stage on initial load, then when they are clicked on they are added to the "reel" and they can be previewed in the order that they are added. Now, I'm trying to get it so that when they are on the "reel" they can be click and dragged and rearranged.
Here's how the clips are added to the stage in a function called loadClips():
ActionScript Code:
addChild(clip1);
clip1.name = "1";
Here's how they are being added to the "reel" in addClips():
ActionScript Code:
if (currentTarget.name == "1")
{
clipCopy = new Clip1();
[Code]....
Now, I just want the clips that are on the reel to be click and drag-able (along the X axis but I'll worry about that later). I realize now they're all being added as clipCopy. That's going to be an issue huh? Is there a way that I can target the container and make that mobile?
View 2 Replies
Aug 8, 2002
is it possiable to target/query a specific frame in a movie that i am loading into an empty MC...?
eg:
on (release){
if (loadedMoviePath._currentframe == 10);
loadedMoviePath.MC1.play();
}
loadedMoviePath - what would the path to the MC in the movie that has been loaded be?
whatGoesHere.MC1
View 2 Replies
Nov 5, 2006
I'm trying to target a .swf that I loaded into a movie clip (mc_container) but it seems like I'm missing something. Can you take a look and see where I went wrong?
Code:
mc_container.loadMovie("mc_photoSwap.swf");
//homepage Animation Swap Images
function photoSwapAni(){
switch(random(3)){
[Code]...
Also I see I'm going to have an issue with the random part because it could call the same animation twice or more times in a row. Should I ad some sort of if statement or is there a better way to do this random part of the code?
View 10 Replies
Jun 27, 2009
how i can set the size of an external swf i have loaded into a target movieclip ive got the external swf loading into the target ok but its too big.
View 2 Replies
Jul 30, 2010
A part of the Flash app. I'm working on right now does the following -Main stage loads an external swf using the following function:
function loadAsset(evt:String):void{
var assetName:String = evt;
if (assetName != null){
[code].....
View 25 Replies