ActionScript 3.0 :: Loading External Swf In A For Loop?
Sep 23, 2011
I would like to create thumbnails in a player. For that, I have to load external swf files in a scrollPane component.
so in a for loop, I attach a thumbnail container in the scrollPane content, and with that container I load the swf.
the idea of the code is that :
mcThumbnailsScrollpane:MovieClip = menu.thumbnailsScrollpane.content;
var X_pos = 30;
var Y_pos = 25;
[Code].....
and so basically 8 or 9 thumbails are visible (on 34). furthermore when I skip the loadMovie and let only the container, I can see all containers. so I feel like the ScrollPane is not refreshing fast enought, or the movies take too long to load ...
View 6 Replies
Similar Posts:
Jul 28, 2009
I have a bit of a problem finding the correct syntax. I have a whole lot text variables here. The myLV value is in a external text file. So myLV.nr1 from my external textfield is loaded in ovrnr1.text. This way I can easily change the value in my text document.
ovnr1.text = myLV.nr1;
ovnr2.text = myLV.nr2;
ovnr3.text = myLV.nr3;
ovnr4.text = myLV.nr4;
If I put it like this it works fine but I thought, hey, in stead of writing
150 of these I can put it in a for loop. So I tried this.
for (i=1; i<150; i++) {
ovnr[i].text = myLV.nr[i];
}
However, this does not seem to work ? And could I do it to a button too ? So instead of writing 150 button onrollovers I could also make a loop for it ?
Something like
for (i=1; i<150; i++) {
this.btn[i].onRollOver = function() {
[Code]....
View 2 Replies
Jun 25, 2011
I've spent days working on this code, it seems so simple, but yet it never works. All I'm trying to do is make a loop automatically load person0.swf through person4.swf in the same directory. I've got it set-up so that I can change a single number and it loads up to person[whatever-the-new-number-is].swfCurrently it loads the first movie and thats it. I also get this error: "TypeError: Error #1009: Cannot access a property or method of a null object reference.at Menu()"Here is the code
package {
import flash.display.*;
import flash.net.URLRequest;
[code].....
View 3 Replies
Mar 2, 2012
I 'm checking to see if an image file exist but I don't think the code checks but the last iteration in the loop. Here's my code:
[Code]....
fix this or if you know a better way to check if an image file exist could you let me know.
View 1 Replies
Jun 30, 2010
Im working with FlashDevelop and have two main projects, all pure AS3 projects.When trying to load my second project from my main project I get all kinds of errors.The Main class of the main project extends Sprite and the Main class in the "to-be-imported" project extends MovieClip. Looking at the loading of the swf in the debug window in FD it all seems fine:
[SWF] 'pathToSwf'secondProject.swf - 410 626 bytes after decompression.
If i try to assign the loaded swf to a newly created MovieClip I get a coercion failiure:
swfContent = loader.content; // =>
Type Coercion failed: cannot convert Main@46c0201 to flash.display.MovieClip.
So, typecasting the loaded content like so:
swfContent = loader.content as MovieClip;
removes that error but then I fall into the next pit as I try to call addChild:
Error #2007: Parameter child must be non-null.
Trying to get around the issue I tried to add the loader directly into the container where I want to show the external swf. This is when the real interesting problems begin:
targetContainer.addChild(loader);
My main application now hang, restarting in a never ending loop. How can my external swf be loaded but then again be null.It works perfectly fine when I run the external swf by itself...
View 5 Replies
Oct 11, 2009
I have a movieclip clip that plays when the movie starts, the movieclip is a visual assets that show's that the application is loading some information but it's not showing any loading progress, just playing while the assets are loaded.I created a for loop that will load the assets using a simple loader, and then when the object is loaded the application push the object to an array.Problem is that when the loading starts all the animation that i have on screen stops until the loading is finished.The whole point is that the animation will play while it's loading.
View 10 Replies
Feb 23, 2011
I spent almost a week trying to figure out how to unload a currently loaded swf using its button and loading a new swf... I have three files, a main.fla, file1.fla and file2.fla. In my main.fla, I have a code which loads the other two files. If i will click the "unload" button in the file1.swf, I would like the main.fla to unload the file1.swf and load the other file, file2.swf. Here is the code to load the file1.swf:
[Code]....
View 1 Replies
Jun 4, 2004
[FMX] I am having trouble loading an XML file on an external server into my flash movie when it is uploaded. The data loads in fine when the flash file is on my local computer with the xml file on a server. As soon as the flash file is uploaded the XML data will not load in.
View 2 Replies
Nov 2, 2010
I used to do this fine with AS2 and now i'm struggling to get it to work in AS3.my code is as follows:
PW1.addEventListener( MouseEvent.CLICK,loader1 );
//==================== PS function =============================================
var ldr:Loader = new Loader();
[code].....
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
Jul 19, 2009
I want to load external png's through this code:
(for this code, check the mcBandPreloader in de .fla file)
Code:
var imageLoader:Loader;
var RespJpeg:String = "images/arch1Proj.jpg"
function loadImage(url:String):void {
[Code]....
Here the problem is that I can't type html in my external txt file. (I did checked the html button in Dynamic Text Properties. What am I doing wrong here?
.fla can be downloaded at [URL]
View 2 Replies
Mar 16, 2004
I'm loading a external swf into a movie everything is fine with that. The only problem is that its loading only a part of it. Does anybody know why? Also, this swf is a mp3 player with streaming. The streaming part works but the playback doesn't.If i start only the mp3 player by itself it's working.here is the fla for the player
View 3 Replies
Apr 20, 2005
I'm trying to load a SWF movie into a target movieclip called blankmc. The SWF movie is loaded from an absolute URL (eg. [URL]/img/20042005113934movie3.swf ) My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG! Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
[CODE]...
View 3 Replies
Apr 10, 2009
Specifically, I am building a flash page that loads external swf files and inside some of the external swf files, I would like to add audio and flash video (flv) streaming from the Flaash Media Server. In some of the external swf files, (using a FLVPlayback component) when you press a button on the main timeline to unload the current playing swf the audio/video continues to play after loading the new external swf file.So I believe that my approach is all wrong and I should be working to dynamically load the .mp3 and.flvs in the external swf ... my questiion is how to unload those assets when loading the new external swf
View 1 Replies
Jun 27, 2009
Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()
seems loader class can not access sub.swf's external class when sub is being loaded.
View 1 Replies
Apr 24, 2010
Lets say I have subgallery.swf file that loads jpeg images. And I have gallery.swf file that loads subgallery.swf.The jpeg images and both swf files are in the same folder.When I test gallery.swf it loads subgallery.swf but subgallery.swf doesn't load images. When testing subgallery.swf alone, it loads jpeg files.Is there any limitation or setting preventing external swfs loading other content?
View 2 Replies
May 24, 2005
I created a site using Kirupa's external .swf loading tutorial. Now in one of my externally loaded .swf's, I am loading another external .swf. I've gotten this to work fine, but the second external .swf (loaded into the first) contains buttons that will swap this second external .swf with another external .swf. I can't seem to get the AS references to the variables set up correctly in order to swap the swf's. The initial .swf loads fine, but the button control gets complicated inside it. It sounds rather confusing, so I've included a link to the .fla's and .swf's below.
[URL]
The file structure:
-band.swf load's profiles_main.swf
-The buttons in profiles_main.swf are trying to load chris.swf (swapping it entirely with profiles_main.swf)
View 3 Replies
Apr 24, 2010
I have subgallery.swf file that loads jpeg images. And I have gallery.swf file that loads subgallery.swf.The jpeg images and both swf files are in the same folder.When I test gallery.swf it loads subgallery.swf but subgallery.swf doesn't load images. When testing subgallery.swf alone, it loads jpeg files.Is there any security limitation or setting preventing external swfs loading other content?
View 3 Replies
Feb 1, 2010
I'm trying to load external SWFs in a for loop, and I have this problem that is really eating me: In the event handler I need to know the filename of the SWF that was loaded, but I can't obtain this.
function loadManySWFs(arrayOfFileNames:Array)
{
for(var i=0; i<arrayOfFileNames; i++)
{
[code]....
View 1 Replies
Aug 10, 2009
I'm trying to learn how to load multiple images from an XML file, I have the XML file done with the image names and X,Y each one should be loaded on the screen, but I'm totally lost on the AS3 file.Here is the XML code: XML
ActionScript Code:
package
{
import flash.display.Sprite;[code].....
View 6 Replies
Mar 29, 2011
I'm trying to load a couple of images and store them in an array. After this process is complete, I want to loop through the array and add these pictures to the stage.Here is my code:
Code:
var imagePaths:Array = new Array("1.jpg","2.jpg");
var imageArray:Array = new Array();
[code].....
View 1 Replies
May 2, 2011
I am writing a preloader to load an external SWF. Here is the code:
ActionScript Code:
import flash.display.Loader;
import flash.events.Event;[code]...
Etc. It keeps going until I close the movie.For some reason it's continually trying to load the movie...and I have no idea what. I literally copy and pasted the loader from a different (working) loader and swapped out the URL to the file.
View 4 Replies
Sep 17, 2011
create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
ActionScript Code:
var pageXML:XML;
//Load the XML file.
var pageXMLLoader = new URLLoader();
[code]...
View 0 Replies
Sep 17, 2011
What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.
What I don't understand is how to pull the swf or image file from the file like I have with the text. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
Code: Select allvar pageXML:XML;
//Load the XML file.
var pageXMLLoader = new URLLoader();
pageXMLLoader.load(new URLRequest("scripts/xml/content.xml"));
pageXMLLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlIOErrorHandler);
[Code].....
View 2 Replies
Apr 18, 2007
I have problem with loading an image from a loop.The method I used is I created an array, then load the xml file with the images. And in the loop, where also the menu is created, I called through the array the wanted image from the xml.I tried to find the problem, but I don't get it to work as I want.The output says that the url is undefined, but sometimes when I try a different aproach, it loads constantly the same picture.
View 1 Replies
Apr 26, 2002
I've a .txt-file containing variables. The variables are structured like this:
aaa_301, bbb_301, ccc_301
aaa_302, bbb_302, ccc_302
...
[code]....
View 9 Replies
May 21, 2009
I'm loading XML, but I'm having trouble making a for loop so that I can output into text fields my xml info. I use this to load and put into the output window. Eventually I will put it into a text field. What I want really to do is for flash to output a list. This is what I want it to look like.
PHP Code:
var newsXML:XML = new XML();
newsXML.ignoreWhite = true;
var output:String = "";
newsXML.onLoad = function(success) {
if (success) {
var news:Array = newsXML.firstChild.firstChild.childNodes;
[Code] .....
If you look at this XML you will see that there are many different Tournaments. What I want is to have them all in a list. I also want to have scrolling bar.
View 6 Replies
Apr 22, 2009
iam creating a pallete in that i have a class movieclip with 1 image and 2 text (title, desc). Here iam connecting a xml and creating the same class and adding it to the scrollpane. in that each item (movieclip) i need to load images and fill the text. iam filling the text and loading the images. but i need to scale the pictures to 35x35. actual size of the pic is 70x70.my code is :
function fillitem() { var ypos:Number = 10; //reptitle.text = myxml.toptitle;
reptitle.text = options[0][0].tit; var tf1:TextFormat = new TextFormat(); tf1.color = options[0][0].col; tf1.size = options[0][0].siz; tf1.bold =
[code].....
View 1 Replies
May 25, 2010
I'm just trying to loop this array, it works, I just can't get it to loop:
ActionScript 3.0 var videos:Array = new Array("videos/movie1.flv", "videos/movie2.flv", "videos/movie3.flv");
var currentVideo:uint = 0;
myVideo.mouseChildren = false;
function playCurrentVideo():void {
[Code] .....
I've found a bunch of threads for AS2, but I just can't get anything to work. Not as important, there's a quick gap between the loading of each video when this runs. Can that be improved?
View 2 Replies
Jul 26, 2010
I am loading a XML of county data for western US states and assigning listeners to movie clips of those counties. The counties have names that are equal to the field named afips in the xml. I am trying to assign listeners to those movie clips as called through a for loop. The counties are children of the parent MC name all_cnt.
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
[Code].....
View 7 Replies