ActionScript 2.0 :: Random LoadMovie Function - Location Of External SWFs
Apr 5, 2005
I'm having a problem with embedding a Flash movie that loads an array of SWFs- specifically, ones that exist in the same movie as the .fla loader file. When I move the external SWFs and .swf load_movie file into a separate directory from the HTML file, they do not load properly. I get just a white window. [URL]. When I keep the SWF movie clips and load_movie.swf in the same (root) folder as the .html file, then everything loads properly, though. But this would extremely clutter up my directory!
The code is as follows:
MovieClip on Stage
onClipEvent(data){
//test to make sure it's completely loaded, when swf's load this way onData is called with each 'chunk' of data
if(bytesLoaded()==bytesTotal()){
this.onEnterFrame=function(){
if(_currentframe==_totalframes){
_root.loadNextMovie()
[Code] .....
I 'm not sure if there is a way in loadMovie to specify another folder, or the best way to solve this problem. I'm relatively new to Actionscript.
View 3 Replies
Similar Posts:
Oct 13, 2005
I'm having a problem with embedding a Flash movie that loads an array of SWFs- specifically, ones that exist in the same movie as the .fla loader file.When I move the external SWFs and .swf load_movie file into a separate directory from the HTML file, they do not load properly.Url...When I keep the SWF movie clips and load_movie.swf in the same (root) folder as the .html file, then everything loads properly, though. But this would extremely clutter up my directory![code]I 'm not sure if there is a way in loadMovie to specify another folder.
View 2 Replies
Mar 2, 2007
I've been trying to use loadMovie to load external SWFs into 200x200 MCs arranged on the stage. What I get is a strange placement of the loaded movies, and, the loaded movies don't appear as they should. The loaded movies are really all the same: they display 4 squares that change randomly every 3 seconds.
1) The loaded movies seem to use their center point as the registration point instead of the top left corner. Why? How can this be changed?
2) The loaded SWFs ("1.swf", "2.swf", "3.swf") get transformed from 200x200 pixels to 100x100 pixels. Why?
View 3 Replies
Jun 6, 2006
how to do a random internal movie clips NOT calling external mcs with loadmovie?Let's say I have two internal mc's with instance name : my_mc1, my_mc2 and I want them to load randomly in starting in frame 2 here what I did so far:
var tab_mc = [this.my_mc1, this.my_mc2];
function randomMC(tab_mc) {
var i=tab_mc.length;
var r = (Math.floor(Math.random()*i);
[code]....
View 4 Replies
Nov 10, 2009
I have this code that I am using to randomly load in external swfs. It seems to be working but, as I know very little about coding I just wanted to ask the experts and see if its ok? or should be done differently. I added the preloader code from watching the tutorials but not sure if its even in the right place?
Code: Select allimport flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
[Code].....
View 4 Replies
Dec 4, 2006
I'd like to make a "main" flash movie to load external .swfs. It's not a problem to make it load a random external .swf but how could I make the loaded .swfs randomly load another .swf on the root at the end of its timeline?
View 5 Replies
May 23, 2008
detailed as possible. Took basic Flash classes, but no AS other than searching online, taking a couple Kirupa tutorials, so it's all greek tho recognizably so. I have 10 individual "scenes" currently in one swf file, but would love to break these apart individually, and load each into a "container" swf with a "random" code (so each visit to my site starts differently) which I've located and tested with Kirupa's super "Loading random movies" tutorial. Question is: currently I have active buttons in each scene which advance playhead to the next scene. How can I code these to load another swf into the main "container" file and kill/replace the current swf?
Another tutorial "Transitions between external swfs" suggests "if your buttons are not located on the main timeline, you will have to change the path to the container movieclip" - but doesn't show exactly how to do this, and I have to say I can't figure the "path" out! Another issue I foresee is that I'll need the script to automatically pull in the next swf file when the current one finishes, if the visitor doesn't click the button first... Haven't been able to find this with a few hours searching, though some threads come close.
View 1 Replies
Aug 14, 2008
I have 20 external .swfs im trying to load into 20 blank movieclips . i am trying to load them randomly into each blanck movieclip without the external .swf's duplicating.
so far I have this code
[Code].....
Im trying to load all the movieclips with all the external .swfs without any
of the .swf's repeating.
View 2 Replies
Dec 7, 2005
I want to load an external .swf file through the loadMovie function. The problem is flash takes sometime to load the file and therefore what ever commands I put below the loadMovie function, will not work. Placing this commands say 10 frames from the loadMovie function works but when online and you have a slow internet connection, it yet again fails. How do I solve this problem? I tried using onLoad but from what I gathered from several sites, it will not work with LoadMovie.
View 6 Replies
Jan 19, 2009
I'm trying to use a loadMovie function inside a loop to load external PNG files when my game is loaded. Unfortunately, I can't get even a single loadMovie to work correctly, much less execute a bunch of them.The code is on the root time line, and is targetting an empty movie clip that is nested inside about 3 levels. There is a button, with a movie clip on it, and the empty clip I'm trying to load into on that.so the full target path is myBox_00.smallBox.myLogo(myBox_00 is the button, smallBox is the movie clip, and myLogo is the empty)[code].I even tried using a JPG image instead of a PNG and still no luck. The best I could do was number 4; and that didn't work, all it did was SOMETHING instead of NOTHING... unfortunately that something was to make the button (myBox_00) disappear entirely T_T.I've never had much luck with loading external images. What am I missing here?
View 9 Replies
Sep 2, 2006
[URL]regarding this tutorial I started my site [URL] to get some trasition effects but im getting somewhat different since the external SWFs take time to load. isn't it better to create "intro and outro" on the same time line instead of loading external SWFs bcos once the movie loaded as a whole will lead to smooth and contineous transitions.
View 1 Replies
May 24, 2009
So I want to make some movie clips function as buttons to load some external swfs. I have this action script on the mc's:
on (release)
{
loadMovie("Chuck.swf", "motionmc");
}
It was working when it was a button, but now nothing happens?
View 2 Replies
Aug 15, 2005
I recently created a site using the "Transitions between External SWFs" tutorial for Flash MX 2004. I use this to load the sections of my site into the main movie file. Each section is an External SWF file. When a viewer clicks on a navigation button, the specific external swf move will load and play. Currently, a viewer would need to click on another navigation option to close the current external swf file. I would like to add a close button to each of the external swfs so that a view has the option to close the window without clicking on a naviagtion link.
View 12 Replies
Aug 7, 2009
In CS4, using AS 2.0, I'm using loadMovie to pull in different ads (swfs).This is working great, but one swf is not getting along. It was coded in AS 3.0, and some content beneath masks is not displaying correctly.I obtained the original fla file, but still can't come up with a solution.I tried setting it to 2.0, but then none of the AS works.I don't know Actionscript very well so rewriting the ad's functions is not an option.convert the swf I'm trying to load in? Or an alternative to loadMovie in 2.0?
View 3 Replies
Aug 11, 2009
Trying to load swfs with loadmovie script. They load fine but when close window button is pressed the Main movie behind it dissappears to blank screen.
View 2 Replies
Apr 7, 2009
is it possible to loas as3 swfs with loadMovie into as2 swf and keep them working? i have a whole as2 swf website and i want to embedd an as3 flv player....
View 1 Replies
Jul 24, 2004
I'm trying to load some swf movies using loadMovie, but I'm having the following problem: There are three movies: 1.swf, 2.swf, and, 3.swf.
=> 1.swf loads inside 2.swf
=> 2.swf loads inside 3.swf
When I test 3.swf, it plays only 1.swf (exactingly where I put it in 2.swf - coordinates) but doesn't play 2.swf. Everything looks correct, including the containers. All actionscript is in the frames and I'm using Flash MX.
View 1 Replies
Nov 19, 2007
I'm building a banner with 5 separate themes for a website. Instead of using scenes and bulding a single .swf, I figured I would build 5 separate .swfs, then when one finished playing it would be unloaded and go to the next .swf. Then finish at, say, 5.swf. There is no user interaction (onPress, etc.).I can't seem to find an A/S method for doing this. Most of what I see is using the loadMovie with an interaction.
View 14 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
Nov 13, 2010
I am loading eight external swfs by way of eight buttons with actionscript to remove the swfs and sound after a new button is clicked. This works fine except that as soon as you get to the frame where the actionscript is all the swfs load at one time on top of each other. I don't want any to load until the button is clicked for the right one. MouseEvent listener works but only after all the swfs have loaded. How do I get the swfs to load only when the buttons are clicked. I can't figure out what I am doing wrong.
[Code]...
View 5 Replies
Jul 21, 2009
I need an actionscript that moves 1 dot to random location. This dot is over 200 frames, would I have to put an action on every one of those frames...and note that I said Move not jump to another place.
View 1 Replies
Aug 9, 2011
I have a fieldgoal kicking game that I am making I have the basic game done, but I have some things that I want to add but I dont know were to look to the resources. 1. I only want one football on screen at a time right now as many times as you click it kick's a football 2 I also want the placement of my fire arrow to be in a random location for each kick
View 5 Replies
Aug 22, 2009
I am working on a flash file that imports xml data. This data gets run through a for loop and each xml child gets its own movieclip called menuItem. Then the various instances of menuItem are randomly placed on the stage. However, they always overlap to some extent. I don't want this.
So, how would I make sure they don't overlap? I looked at the hitTest function but it seems to require 2 different movieclips to check for the collision. I only have one movieclip with multiple instances.
View 10 Replies
Jul 27, 2004
I want to code a button to duplicate a movieclip instance and I want it to move to a random location within certain boundries. I can duplicate it okay but i can't figure out how to move it.
View 1 Replies
Aug 6, 2009
supposing there is a movieclip in stage.. let's say its a circle with an instance name of "theCircle"..
the circle has to move / go to / animate to a random location on stage every 5 seconds... basically, the circle should move to the random location, stop and wait for 5 seconds, then move again to another random location.. again and again...
the code below is untested and incomplete.. but it is what i am trying to do... how i should go about this...
ActionScript Code:
var randomXPosition:int;
var randomYPosition:int;
var positionTimer:Timer;
[Code]....
on the moveCircle function, i can simply set the X and Y of the circle equal to randomXPosition and randomYPosition... but that would just change the location of the circle, not move it.. i am trying to make the circle animate towards that location at a constant speed..
View 1 Replies
Jul 30, 2003
i have 2 scripts that work fine on their own... but i can't figure a way to combine them.the first part resizes an 800x600 image to match the screen size:
bgHolder_mc._width=Stage.width;
bgHolder_mc._height=Stage.width/4 *3;
this works fine on its own if the image is on the stage.the other pulls a random image and loads it into bgHolder_mc:
backgrounds = new array ("background0.jpg", "background1.jpg", "background2.jpg");
function randomBackground () {
randomNumber = random (backgrounds.length);
[code].....
View 2 Replies
May 16, 2002
The tutorial in The Best of Kirupa isn't working for me! When I try doing this:
rn = Math.round(Math.random()*1000000);
loadVariablesNum ("flashdata.txt?reload="+rn,0);
I get a debug error: Error opening URL "file:///C|/pathtofolder/flashdata.txt?reload=263757" Where the reload variable is the random number and flashdata.txt is the file that contains the variable I need.
View 9 Replies
Feb 12, 2009
I have a Master SWF file that needs to load one of five different content SWFs on a random basis. In other words, I would like the visitor to see a different one of five content animations each time he/she visits the page. Is there a way to just call one of five different URLs on a random basis? Here's my code so far:
var swfLoader:Loader = new Loader();
swfLoader.x = 12;
var swfURL:String = "b2bAnim1.swf"
[code]...
I would like to randomly differ the URL variable (swfURL) to select one of the following five URLs:
b2bAnim1.swf
b2bAnim2.swf
b2bAnim3.swf
b2bAnim4.swf
b2bAnim5.swf
View 3 Replies
May 4, 2011
I have created a main "site.swf" file that loads a "default.swf" file into a container after a preloader. On this default.swf file I have buttons that needs to load new external SWF files in its place in the container. All of the external SWFs contain buttons and navigations that will also call up other external SWFs into this container. So, I would like to know how to program each button (some are movieclips as buttons) to unload itself and load the respective SWF into the container (eg. AboutUsButton to call up aboutus.swf into the container). I do not have a main navigation on the site.swf file bacause the navigation changes on each SWF that needs to be loaded into the container.
View 2 Replies
Aug 23, 2005
How would I write the following in ActionScript...
- I have 2 external SWFs I want to load. Their height will change over time as I add more content to each SWF.
- I want to load one SWF, then directly below it, load the other SWF.
- The X-location and width of the SWFs should never change.
How would I code something that loads an external SWF, checks the Y-height of it, then loads another SWF below it?
View 9 Replies