ActionScript 2.0 :: Accessing Movieclips In Externally Loaded .swf
Aug 10, 2009
I am a newbie to AS 2.0..I only have basic actionscript 2.0 knowledge."I have one main .swf file and several external .swfs which I am loading through this code.[code]Now my problem is that I would like to access one "close_mc movieclip" in ourGroup.swf ...so that clicking that clip, I can exit the externally loaded .swf from the main .swf file."
View 3 Replies
Similar Posts:
Jan 17, 2010
I have a swf file which contains in its library couple pictures. After it is loaded using preloader I would like to be able to create couple instances of them and add them to the stage
If I use swc approach and import it in library path I can not preload it but instancing is very simple i.e
Code:
public var pic:Pic1 = new Pic1();
and that's it, I can add it then to stage then.
How to access them when doing it with swf and loader class?
View 1 Replies
Jan 21, 2011
I am building a touch screen kiosk Air App using Flash CS3 and Air 1.0.
I have my application downloading external SWFs for different advertisements, one of which will need access to the webcam built into the kiosk.
By itself, the advertisement accesses the camera just fine, however Camera.getCamera() returns null when it the SWF loaded into the kiosk app. Both the main kiosk app and the advertisement app are compiled using Air 1.0.
It appears that I'm getting a security sandbox violation, however I'd like to avoid completely rewriting my app using the sandbox bridge architecture just so one of my ad pieces can access a webcam.
Does anyone have any suggestions or know of any work-arounds for allowing webcam accesss from within an embedded SWF in Air?
View 1 Replies
Apr 23, 2011
Using Flex 4, I have created an SWF that has the following code:
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import com.Index ;
protected function start(event:FlexEvent):void
[Code]...
View 1 Replies
Feb 22, 2012
I have loaded an external swf into loaderTopBanner. It works to manipulate that, but not the individual buttons within it. (e.g. btn_Home, btn_Info)
loaderTopBanner.btn_Home.alpha = 0;
View 2 Replies
Jul 22, 2009
I am loading an SWF created in Flash CS4, using the 3d translation tool.The SWF is being loaded into an application being build in as3 in flex builder 3.I can manage to load the movie however the stage has disappeared. All of the objects that exceed the boundaries of the (banner) remain visible instead of being cropped by the stageI attempted to mask the swf before publishing which did not work, and I attempted to programmatically assign a mask once it was imported which also did not work.None of these options threw errors, in most cases they either had no effect whatsoever or the movie simply disappeareI've read numerous posts on this and the answers always seem to be vague.Based on my research I need to access the stage properties of the SWF being loaded, but am unsure how to go about it.Do I need to compile the movie, export a swc and add it to the build path for the project?Do I HAVE to use a document class for the SWF I want to load in order to access it?Do I need to add anything else to the source or build path for the project in Flex Builder?
View 5 Replies
May 24, 2010
I am trying to set a couple of properties (specifically width and height) for an mc within an externally loaded swf but am having bigtime troubles. Keep getting the 'Error #1010: A term is undefined and has no properties'. The code is attached below. I have tried to figure this out and searched for solutions but could not resolve this myself.
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
[code]......
View 1 Replies
Jun 24, 2009
here's what I have (simplified to only show necessary code):
Main Timeline:
var currentItem:String = 'applesauce';
(then some code to load an external swf)
[Code].....
View 1 Replies
Aug 5, 2010
I have loaded one swf externally in my main class. and there is one button in loaded swf suppose its name submit_btn. i have to do that when i click on submit_btn, this loaded swf should be removed. what is the code for that
View 1 Replies
Aug 11, 2009
I'm slowly working my way through AS3, and have a question about how to do this. In as2, you could just load a swf file, then use attachMovie("itemLibraryLinkageName");. I know in AS3 you have to use addChild() to add items to the display list, but how would you go about adding the library items to the stage from an externally loaded swf in AS3? I've tried:
Code: Select allvar library:MovieClip;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);[code].......
View 2 Replies
Jul 27, 2009
I'm trying to set up a large project that has a "shell" application that preloads and eventually displays a bunch of SWFs as a "slideshow". Each SWF could be authored by different people but will reference a base document class so they exhibit consistent behaviour. One of these behaviours is to be able to localise the slideshow into different languages. Since each SWF could have a different number of textfields that need to be localised embedded into their main timeline, the SWFs each must declare their stage instances in their document class. In order to implement the common functionality (such as a "localiseText()" method), I have decided to package all common functionality into a superclass (what I'm calling "Base Class" in this example) and using a subclass as each slide's document class.
This Example:This is a simple example I set up because in my actual project my compiler was throwing a coercion error when I tried to cast the Loader.content as my external class. The structure of this example is the following:
+ loader.fla : this is the main "shell" application.
+ SWFLoader.as : the Document Class for loader.fla
+ external_1.fla : this is the external SWF file that will get loaded and displayed
[code]....
I've set it up this way because a hypothetical external_2.fla might have different public variables to declare its stage instances so would need a separate implementation of ExternalBase (presumably External2.as).
The code (in reverse):
base/ExternalBase
[code]....
This just sets up the localiseText() method which is used in this example to change the contents of the text field. Since we don't know the name of the text field in the particular slide's timeline, we have to ask for it from the subclass' implementation of getLocalisableTextField(). We declare an abstract function here that needs to be overridden in the implementation.
[code]....
View 11 Replies
Apr 30, 2011
I have a document class which links to several classes, one of which adds a container onto the stage and loads external .swf's into it.Q: How do I access the various classes loaded in the document class from the external swf timeline?For instance, when you click a button in the loaded swf it changes the soundtrack from the soundtrack class. I have tried dispatchevent from the external swf timeline, but I still can't seem to get it to work. Is this supposed to work, or should I be doing something different?
View 1 Replies
May 23, 2009
How would you go about accessing a function or variable from a parent clip if the clip accessing has been loaded using the Loader() constructor in AS3?
View 1 Replies
Oct 28, 2008
I am trying to create a graphical representation of the DisplayList of a flash site that is loading many external swfs. I want to be able to filter what is displayed (ie. Show only textfields, or show only images, or show only whatever). I have not been able to find a way to distinguish or select only the swfs. I would like this to be able to list ALL the swfs that are used in this projects and nothing else..
View 2 Replies
Mar 10, 2012
I have 2 swf files. One is loaded and loading an externally loaded swf into it.Here is the code in the first loaded swf: #1
var logo:Loader = new Loader();
logo.load(new URLRequest("images/Logo.png"));
logo.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadLogo);
function LoadLogo(e:Event):void
[code]....
EDIT:I am having major SANDBOX issues now when I make the clip load from an external URL. I am also coding for an ANDROID using FLASH CS5.5. Its not allowing me to use Security.allowDomain("*");
View 1 Replies
Jan 18, 2010
I am having a newbie problem here. I am loading an external SWF with embedded movieclips (all clips are set to export in the original file). However, I can't figure out how to access those embedded clips in my new, parent, flash file. Here is my code:
Code:
var container:MovieClip=new MovieClip()
var house_Loader:Loader = new Loader();
[code].....
View 4 Replies
Dec 19, 2009
I have two SWF-Movies. One is exported into eht other as Child.Can I instance the Objects of the two libraries in all places, where ActionScript is possible? (In Keyframes of the MovieClips and in external class definitions.)
View 3 Replies
Aug 30, 2005
I am in the process of building a site for an Architect... Jamie Fobert Architects (projects) I am useing transitions between the projects and am loading details/text and images externally through flashvars, php and a mySQL database. Within my transitions I have a a preloader on the forst 2 frames the code is as follows (taken from a Voetsjoeba tutorial):
[Code]....
This works pretty well if the content is within the .swf, but when it is loaded externally it doesnt preload it at all. Does anyone know how I can adapt/improve this preloader? or somehow ensure that all the content being loaded externally is loaded before the transition plays?
View 2 Replies
Aug 22, 2009
Here is the problem:I have 2 external as3 files in a "com" folder next to the FLA within which i am working. The first of these ( "Main.as") is the document class. The second ("events.as") contains variable definition "myVar:Number = 0" which i want to be able to access and change inside Main.as. I am sure that this is possible, but i can't get it working (flash very keeps pointing out that I have made an error. Specifically that old classic: "1046: Type was not found or was not a compile-time constant: myVar." which has puzzled me since the dawn of time.
View 3 Replies
Feb 16, 2006
I am loading an externally loaded swf that uses a mask to transition in. When the user clicks a different button I am doing a gotoAndPlay that goes to a mask that "unloads" the content (it doesnt actually unload the info is just outside of the mask area. As soon As I jump to that section the movie is no longer loaded and just shows the container clip that I had created for it. The Container Clip is never changed and is the same throughout the whole process. The only thing that changes is the mask animation.I have tried both loadClip and loadMovie but no luck on keeping the clip loaded.
EDIT - I have narrowed it down. When I change the mask movieclip the movie unloads for some reason. Is there a way I can keep it loaded?
View 2 Replies
Oct 5, 2008
I am still transfering from AS2 to AS3 and right now i am having a very annoying problem. THE STRUCTURE:
Maintimeline contains 2 buttons that i want to use to access children in a bunch of movieclips. rectangle_mc has circle_mc circle_mc contains xx_mc xx_mc contains wtf_mc placed on frame 1 on maintimeline Why can't flash see my nested movieclips? I remember in AS2 you could go down the line:
[Code]...
View 15 Replies
Jul 30, 2010
I am starting with AS3 programming icm with Flash Builder 4.I have created a "Main" class which is the initial stage.On this stage there is a movieclip called mcMain.In this mcMain is 4 other movieclips: mcStats1 mcStats2 mcStats3 mcStats4 .How can I access these mcStats1-4 from the code to make them go to another frame?I tried:
var t:MovieClip = MovieClip(getChildByName("mcMain"));
t.getChildByName("mcStats1").gotoAndPlay(3);
But that just keeps giving me null reference errors:TypeError: Error #1009: Cannot access a property or method of a null object reference.
View 4 Replies
Nov 8, 2011
I have a homepage with five "links" to each swf. Now the first swf I have a custom cursor that hides the mouse. When I click on that link it plays and when I quickly go to the homepage again it hides the mouse there when it's not supposed to do it.
Same with every other link. When I was busy with the first swf and want to go to the last swf of the five, my mouse just disappears! It is almost as if it keeps on "playing" without seeing the swf...
Here is the code that I have so far!
var currentpage:uint = 0;
//one loader object per project:
var loadingobject1:Loader = new Loader();
loadingobject1.x = 445;
[Code]....
View 1 Replies
Aug 6, 2010
I m trying to make sense of how to load a swf into a parent MovieClip and allow them to communicate.I ve attached two zip files � one which works fine and the other doesn�t. Unfortunately (for me), the one which doesn�t work is closer to my current project.I need to load movieclips into the parent movieclip. The parent movieclip has controls which rely on values parsed from the child movieclip.In the parent movieclips I wait until the loading is complete and so the values should be passed. However, the values aren�t passed unless I use a button (or timer), to pass the values (see the working exampes).The code which doesn�t work is:
Parent movieclip:
ActionScript Code:
stop();
var myLoader:Loader = new Loader();[code].............
View 5 Replies
Dec 23, 2009
i'm having some "big" issues with what seems like a pretty easy flash concept. But, im pretty green when it comes to coding in flash.
I have a SWF thats being externally loaded into another SWF file (see code below):
on(release) {
loadMovie("test1.swf",_root.dropZone);
}
(If i'm understanding the above code correctly...its loading the SWF into a blank MC i created called dropZone) This part seems to work correctly when tested.
I've got 4 different SWF's that need to be loaded seperatley when its coresponding button is clicked. The issue arises when I import the external SWF file...it resizes itself to the size of the flash stage. I need all the SWFs to be loaded and remain there original size (1257x847) or be scaled to the correct size. Then if I click another button it should load the new SWF and "unload" the old SWF.
View 3 Replies
Dec 2, 2009
if a loader can be added to let the user know the video is being loaded rather than a blank 20-30 seconds...
View 18 Replies
Feb 10, 2010
I'm loading swf's via an XML file. I'm wanting them to be added onto the stage in the same order that they appear in the XML. The problem that I'm having is that they are added to the stage only when they are fully loaded.
This is my xml (_config.xml)
<campaign>
<component SWFsource="logo.swf"/>
<component SWFsource="gallery.swf"/>
[code].....
View 3 Replies
Dec 2, 2009
I have a fairly chunky swf that I am loading through the loadMovie function. Just wondering if a loader can be added to let the user know the video is being loaded rather than a blank 20-30 seconds...
View 1 Replies
Aug 7, 2009
With the assistance of a very kind member of this forum, I have got as far as getting an .FLV to load into my API via its own .SWF.
[URL]
click on "Animalia - Verse from the Zoo" to load the VideoPlayer .swf which contains the .FLV
I will add more functionality when I've solved this. Now that I have a Video Player which closes, the next set of hurdles to overcome are these:
Click "Close" with the .FLV playing and the sound keeps playing because the .FLV is still playing. Click "Close" with the .FLV paused and when you call the player back, it plays from the same spot. So, my tiny brain says it's an "add/removeChild" issue. Obviously when happy user clicks "Close" and then re-loads by clicking "Animalia", happy user wants the video to play from scratch. That's what I want, anyway. Not from where it left off after clicking "Close". I've made several attempts at adding a "remove FLV" object to the function and Event Dispatch method, but what I did is wrong because the code I put in removed the .FLV permanently and when you call the player back by clicking on "Animalia", the .FLV does not play at all. I'm going round in circles looking for the correct NetStream/removeChild/unload.nsplay/etc/etc .. AS3 coding and where to put it.
My .FLV video load object on "NewPlayer.swf" is:
var myVideo:Video = new Video(360, 264);
addChild(myVideo);
var nc:NetConnection = new NetConnection();
[Code].....
My questions is:- What is the correct coding to get the VideoPlayer .swf to unload its .FLV completely, SO THAT when a user clicks "Close". Either with or without the .FLV playing, everything closes completely and when re-loaded, the video plays from scratch?
View 2 Replies
Sep 16, 2009
I am externally loading an flv into an empty movie clip container using loadMovie into a main swf. The flv is in a standard flv playback component and works fine on its own. But what I'd like to be able to do is pause the flv when any of the buttons in the main swf are pressed.
View 7 Replies