ActionScript 3.0 :: Loaded SWFs - _lockroot Come Into Play To Affect Debugging?
Jun 17, 2009
You can only code in the "Main Timeline" or root. But how does that work with loaded SWFs? Like Is there a Stage for each SWF, or only one for everything? Also, how does _lockroot come into play to affect debugging?
View 0 Replies
Similar Posts:
Feb 14, 2008
how to sequentially play external SWFs loaded into the main timeline?
I have several SWF files with short videos embedded in them. I wish to load these external SWF files into my main timeline as follows:
User Presses Button -> Play Video Clip in External SWF#1 -> Once Video Clip in External SWF#1 has Finished -> Play Video Clip in External SWF#2.
I tried achieving this by adding: var endmovie:Boolean = true; to the end of each video clip inside the external SWFs (e.g. 1.swf) then cycling through an if statement in the main timeline to see when this condition was meet:
ActionScript In Main Timeline:
Code:
var mc_Loader = new MovieClipLoader();
mc_Loader.addListener(this);
[Code].....
How is the best way to go about achieving this? Am I on the right track? (By the way, using .FLV or one long external SWF file is not really an option due to long loading times...
View 3 Replies
Sep 18, 2008
On the very first frame in my .swf I have over 3.000 lines of code, mostly just a bunch of functions and variables.
I'm closing in to the completion of my game and I'm about to setup a preloader. However, I was wondering, how will all that code affect the preloader when the game is being loaded in a browser?
Will it cause a slight performance issue at the beginning or should I setup all that code on an empty frame right after the preloader?
View 2 Replies
Oct 10, 2010
I have a swf file that I am trying to load into another swf file. I use the "Loader()" to load the 2nd swf into the 1st.My 2nd swf files runs fine on it's own but when I load it into the 1st swf file I get an error that is very vague.TypeError: Error #1009: Cannot access a property or method of a null object reference.at swf2_fla::MainTimeline/frame1()Cannot display source code at this location.Is there anyway I can debug this error so that I get more info on where it is than just frame 1 why this would happen? My 2nd swf is huge so it's a challenge, I am assuming it's got to do with something being referenced at the root. I do use MovieClip(root)
View 3 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
Sep 5, 2011
I am wondering if somebody here knows how to achieve this:I need to lock the root of an external swf (loaded using behaviors on a button). The reason I need to do this is that I need the sub swf to stop looking for its assets in the main website root, and find them right beside itself in the same folder. I do not have the actual fla of the sub swf, hence the problem.
View 3 Replies
Oct 12, 2010
i took inspiration from the tutorial for the mp3 player (some code will surely look familiar to some of you) to build up a music player that plays songs from a defined array, and made it fully working. Somehow proud of it, i consider myself intermediate in ASing Now, the problem is that then i load this music player into a main.swf there's no sound."hey you surely forgot to add _lockroot". Ehm, no. Actually i did several tries with it. This is why i'm here
Architecture:
- one Main Movieclip (mainmovie.swf);
- one Music player (musicplayer.swf);
Music player is loaded into Main Movieclip through a loadMovie call; absolute path to target would be _root.mp3cont (in Main Movieclip obviously); the loadMovie call happens on the AS layer in the _root of Main Movieclip; about the Music player:
- there's a movieclip on the main timeline that acts as container. Name is "sound_clips";
- the music player is INSIDE the mc "sound_clips";
- music player works with attachSound;
This is the code on the AS layer:
Code: Select allimport gs.*;
import gs.easing.*;
OverwriteManager.init
[code]....
1. I tried to insert Code: Select allthis._lockroot = true; on the FIRST FRAME of the Music player root, that has, as said before, a movieclip named "sound_clips" that contains actually the music player (AS + slider AS); - Didn't work.
2. I tried to insert Code: Select allmp3cont._lockroot = true; on the FIRST FRAME of the Main Movieclip root, where i have mp3cont as container mc for that swf that is load through a loadMovie("musicplayer.swf", "mp3cont"); call. Didn't work either.
3. I created a new file (a blank .fla) with just the loadMovie call and the mp3cont._lockroot = true; (obviously on separated layers) method to see if it actually worked. Didn't work.
4. I removed the container in the music player and put all the stuff on the _root, so the code for both the attachSound and the volume slider are on _root. Placed a big phat this._lockroot = true; but didn't work. Also didn't work with the following ones (the music player IS STILL working):
- this.s._lockroot = true; (put AFTER after the definition of the sound object obviously, as s is not yet defined)
- this._parent._lockroot = true;
5. Without the above mentioned container i tried placing it in the swf that actually loads it, and even tried MovieClipLoader and loadMovie. This is the last attempt:
Code: Select allthis.createEmptyMovieClip("sound", this.getNextHighestDepth());
sound._lockroot = true;
sound.loadMovie("musicplayer.swf");
View 3 Replies
Apr 6, 2009
I have an old swf, perhaps created prior to player 7.When I load this swf into a newly created swf it no longer works as expected. I suspect that it is because it was created with _root used to scope variables.I applied _lockroot to the container MC that loads the old swf but this does no good. I suspect this is because the old swf was created prior to player 7 and _lockroot does not work with these.Now to the question. Is there anything I can do to get a swf created prior to player 7 to work with _lockroot?
View 3 Replies
Jun 10, 2010
I have a "photo" gallery that loads numerous SWFs through xml, one by one on click. All works fine. All my SWF work fine stand alone. But when I load them into the player, many swf dont work properly.in example, I have textinput textfields in many of the swfs, which work fine on their own but not when loaded into the player. Then I have a word search game that works fine when alone, not when in player. I can see there is something as my mouse cursor changes into the "button finger", but nothing visual.
All drag and drop assigments work fine etc. I have no idea whats up. I have receantly switched to as3 and in as2 there was _lockroot declaration that solved similar problems, but now in as3 (where it supposedly should be automatic) it doesnt work. As it seems that it cannot recognise it own stage value, or selection_focus when loadedinside another swf through xml.Using cs4, as3.
View 4 Replies
May 13, 2009
Why can't I get my FLVs and F4Vs to play out of a browser window but they'll play out of explorer through the Adobe Media player?Once I convert them to be SWFs, they play out of a browser but they're still humungous and take a lot of time to play. 400Mgs as an FLV/F4V and 200Mgs as a SWF. Is there a way to shrink them down to a much smaller file size? These were video recordings of long presentations.
View 1 Replies
Jul 16, 2009
I know this is a very basic question and one that I know the anwser to, but it's been a while since I've used Flash and the solution is escaping me right now. I'm loading external swfs into my main swf and they should just be playing automatically. When I test in Flash, the system works. Upon loading the swf into an HTML page, the system seems to shut down. It seems liike the exteranl swfs aren't even loading. This is what I've got so far.
[CODE]...
View 5 Replies
May 16, 2011
I have two animated SWFs on the same web page and I am trying to get them to play at the same time when only clicking on one of them. How do I make this happen?
View 1 Replies
Aug 7, 2010
Usually when I want to create multiples instances of a same movieclip (that's already in the main .fla library) I use new mcClassName()but what if the clip is external, for example Ball.fla, Ball.as and Ball.swf? I've loaded Ball.swf into the main .fla and I don't know what to do now
View 4 Replies
Nov 10, 2010
How to make one swf make another swf play on the timeline, both swf on the same page. I need it so when I rollover the first swf it begins to play the timeline but as soon as I roll over that swf, it causes another swf on the webpage to play its timeline as well.
View 1 Replies
Jul 26, 2010
I need to tweak some code that i have. I have a container file that loads all the swfs, and what's happening is that as the container loads each file (files load from an xml file) it plays pretty well.The next time the swfs play, though, i'm seeing a lot of artifacts during transitions. so i need to unload the movieclips rather than letting them load on top of eachother? here's the container file:
Code:
// import tweener
import caurina.transitions.Tweener;
// delay between slides[code].....
View 1 Replies
Nov 1, 2011
it's possible to use play and stop methods on an instance of an SWF that's been embedded into class using the Embed metatag?I've not been able to get it to work, and have read that it's not possible with video, so am wondering if the same is true for any SWF?
View 4 Replies
May 5, 2009
I've made a simple portfolio web site which loads a swf file containing the navigation at the top and then the navigation loads individual swf files containing full page images.The problem is the full page images are distorting very slightly when they are loaded in. I've attached two images, the first image (picture2.png) is how looks when I just open the image's swf file, and the second image (picture3.png) is how it looks after its loaded in by the navigation.
View 2 Replies
Sep 29, 2008
how to unload the swfs in as3 once you click a button to load a new one.
My file works great, with the exception of the videos playing over each other. slight bummer.
I have five buttons that each pull an external swf that is controlled by an xml file. If there were not sound it would not be an issue, but the sound overlaps if you click to the next link before the first video finishes playing.
I uploaded all the files here, including two test flv files. the files were too big to upload to the kirupa forum.
[URL]
View 3 Replies
Nov 22, 2009
I m loading 2 .swf in one flash file and want to control one with another. The first contain small animation and other has play and stop button. Now I want to control that animation with these 2 button.
Files details:
test1.swf: It has the animation
test2.swf: It has the 2 buttons
test3.swf: It is the main file, in which I m loading the 2 files i.e. test1.swf and test2.swf
View 1 Replies
Jan 9, 2011
This may seem a stupid question but I just started learning AS3, Is it possible to keep my menu on top of externally loaded swfs? My menu is sitting on the main timeline as movieclip and the externally loaded swf overlap my main timeline completely completely covering my menu.[code]....
View 5 Replies
May 5, 2011
I recently changed the setup of my project from only having one SWF, to loading in my main SWF through a preloader. I'm facing a problem of scope. My old code for targeting things no longer works. This is it.
ActionScript Code:
if (this.parent.contains(Credits)) {
Credits.gotoAndPlay(120); CreditsText1.gotoAndPlay(120);
}
What would I change this code to in order to target the exact same spot in my loaded SWF? I should add that all my code is in an external .as file, which is set as the DocumentClass for the loaded SWF. I've tried both "this.parent.parent.contains" and "this.contains" Neither worked.
View 5 Replies
Jan 8, 2011
Is it possible to keep my menu on top of externally loaded swfs? I believe it should be but I just cannot figure out how to do it. I have searched around and I believe I should use something like addChildAt but when I try to use it in the main menu actionscript my external swfs do not load anymore.. My menu is sitting on the main timeline as movieclip and the externally loaded swf overlap my main timeline completely completely covering my menu...
View 3 Replies
Apr 21, 2004
What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames. think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.In the zip file is an example of what I'm trying to do.
View 10 Replies
Jun 23, 2009
I'm trying to use an array adapted from AS2 script to load random swfs called "koan_1.swf" or "koan_2.swf" etc into a "koan_loader_mc" on the stage. Each "koan_#.swf" has code in its last frame to both advance the "shuffle" array in the action script in the first frame of the stage and to load the next koan swf. The code below -- almost -- works, but....?
Frame on main stage:
// creates function called at the end of koan_#.swfs
function shuffle(a:Array) {
for (var ivar = a.length-1; ivar>=0; ivar--) {
[Code]...
View 5 Replies
Aug 7, 2009
I made a music Player swf and it works properly by itself.I recently tried to load it into my main FLA for my website by using Import to Library,and then I dragged it from there into my canvas.For whatever reason, upon rendering it does not work at all, it shows up but none of the functions work and the music doesnt play.Also I tried doing it like this:
I made a preloader that would load the Swf and it actually worked and the functions were all there,however there were 2 problems.First problem was that I did not know how to control where it loaded so it was over my main text and not in the right area.Second problem, for whatever reason the preloader would re run and load the SWF again everytime a function went off (like clicking on one of the buttons or rolling over something that had a color tween) which resulted in it loading like a bunch of the same swf and being a problem.
View 2 Replies
May 17, 2010
I'm building a website made up of different swf pages. After some initial troubles, I have now managed to connect each one and they now all link to each other, however I have a couple of strange problems that I cannot work out.I have one page that contains a non-editable text scroll box, which when previewed in the seperate file works fine, but when it appears in the test for the linked files the scroll box turns into a blank editable text box. I don't understand why this is happening?
My second problem is with my photos page. The page has image thumbnails for the user to click on which displays a larger version of the photo using fade in animation. Again, this works fine when I preview the individual page, however when I test it through the linked files the animation automatically plays and cycles through all the photos. It doesn't do it when previewed individually.
Does anyone have any ideas? I'd be so grateful as I need to have this sorted by the end of the day. I'm using CS4.
[Code]...
View 3 Replies
Feb 10, 2009
I have two swfs on a web page but need them to start playing at the same time. Problem is that one file size is bigger than the other, so one loads before the other and starts playing earlier.
Is there any code that can make a movie wait until the other one has loaded, then start playing in sync?
View 1 Replies
May 5, 2007
Complete idiot question but I know how to load and external swf and have buttons to start them playing. I was looking have them play and then load another and play.I f someone could point me in the right direction to even research this.
Code: Select allvar mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mcl.addListener(mclL);
[code].....
View 14 Replies
Nov 23, 2010
I'm not sure when this started, but when I publish any movie (fp9 or fp10) in the IDE, my SWFs aren't appearing in my browsers (release player 10,1,102,64) ONLY WHEN I'm viewing the swf/html that are on my web server.I can view the local SWF/html if I open those files locally in the browser? I'm on a Mac and I've deleted all my Flash CS4 preferences.
View 13 Replies