ActionScript 3.0 :: Flash Loading XML With Loop Navigation
Feb 27, 2012
I made navigation like this:
Code:
var myMenyArray=[najave,onama,asesoar,kontakt,ponuda,klub,arhiva];
var loader:Loader;
for each (var btn in myMenyArray) {
[Code].....
So Contact button should load text in <contact> </contact> when its pressed and so on.
View 12 Replies
Similar Posts:
Jun 17, 2009
I have an image called aboutus.png which I'm loading through XML into flash navigation. The image isbeing placed into a blank movieClip called "empty" but when the image loads in it looks pixelated and crappy. This is the code in flash that loads my image
[Code]...
View 1 Replies
Jun 6, 2010
I'm working on a flash music site [URL] and am trying to integrate a 480x320 .flv into a frame loop in the "game" section of the main movie.
I first tried loading a .swf version of the same file but I couldn't get it to unload (video and audio) and it really slowed down the performance of the main movie.
That was Thursday.
So I tried to use quicktime but flash CS4 no longer accepts it.
All day yesterday I've been working with a .flv version (which doesn't look nearly as good) and tried to directly import it but got an error ("no such file exists") even when it's right next to the other files.
With the Wizard I tried both picking the local file and assigning the URL of the file previously uploaded to my site.
So i then tried to use actionscript to load it into the actions layer on the frame at the beginning of the "game" scene which after hours of fiddling finally worked.
Here's the current problem:
I just want it to loop until someone clicks to go to another section but now what happens is the video and sound from the .flv keep playing even after you click on another button to navigate away from this scene.
I tried online to find a way to unload the .flv but none of them worked - went thru pages of google searches but the suggested coding did not prevent the .flv from unloading.
here's my code which is in the actions layer at the beginning of the "game" scene:
var vid:Video = new Video(480, 320);
vid.x=231;
vid.y=457;
addChild(vid);
[Code].....
It is very frustrating that Adobe makes it incredibly difficult for an intermediate user to do such a basic thing - load a swf or flv into an fla and have it play, then stop playing when someone navigates away.
View 4 Replies
May 23, 2010
I've got an interesting issue with the actionscript in my file. I've created a slide show with 27 labeled frames - they've been labeled "frame 1", "frame 2", "frame 3", etc... My issue is the first time everything works perfectly, if you hit next or previous. It goes to the correct frame. On the last frame if you click next it should take you back to "frame 1" and basically loop through all the frames again if you keep pressing next. The problem is it goes back to frame 1, and then next doesn't work on this frame. I don't understand what's going on considering the first time around - these frames work perfectly.Here's the code on frame 1:
Actionscript Code:[code]........
View 3 Replies
May 24, 2010
I've got an interesting issue with the actionscript in my file. I've created a slide show with 27 labeled frames - they've been labeled "frame 1", "frame 2", "frame 3", etc... My issue is the first time everything works perfectly, if you hit next or previous. It goes to the correct frame. On the last frame if you click next it should take you back to "frame 1" and basically loop through all the frames again if you keep pressing next. The problem is it goes back to frame 1, and then next doesn't work on this frame. I don't understand what's going on considering the first time around - these frames work perfectly.
Here's the code on frame 1:
ActionScript Code:
stop();
/*Navigation Code */
nextbtn.addEventListener(MouseEvent.MOUSE_DOWN, buttonNextHandler);
[Code].....
View 1 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
Dec 2, 2009
I have been working on a project which has been giving me headaches. I want to be able to navigate through a presentation using the arrow keys - To do everything on the one timeline was going to be too complicated and messy so tried to create separate files but could not get the separate files loading -.My next problem is incorporating the two approaches - here is my code from my test files with my attempt added:
stop();
// create an array to hold the names of the frame labels
var labels:Array = new Array();
// take the name of each label in a MovieClip and put each
[code]....
I can either get the arrow key navigation to work or the previous movie to load but the left arrow key then doesn't navigate back. Although in saying this version doesn't work and I can't get it load again.
View 4 Replies
Dec 2, 2011
I have a loop that parses and works on a lot of data and it takes a long time. While it works away, the screen is blank and im wondering if there is a way to put a loader or counter up?
Since it does a finite amount of work, I thought I could just update the progress from within the loop but further readings has revealed that it wasn't possible.
View 3 Replies
Apr 14, 2006
I want to make a navigation bar that loads image buttons randomly. Ex: (you can see the non-random version at the bottom of the page onI have 5 slots. I want to randomly load an external swf into an empty button in each of the slots. I do not want the same button to load in more than one slot. I'm thinking I need to use arrays? (which I don't know too much about.) Can anyone point me to a useful tutorial?
View 1 Replies
Oct 31, 2009
I am trying to teach myself Flash and AS3 using the two Adobe Classroom in a Book Series so I am not sure if I am framing my question correctly. I have found lots of information regarding loading and unloading, but not about establishing communication between parent and child.I have a home page with four buttons that have nice Mouse Over effects. When I click on them, they load the external swfs nicely. When I click on the external swf, it also unloads just the way I want it to.[code]Inside the external swf, I have two back and forward buttons (it is a slide show type of thing), that are not accessible when I click on them because if I do, I just unload the content from myLoader. If I remove the unloadcontent function from my main home page FLA, the swf's buttons work great, but I can't remove the external swf. I have also experimented with having a close button appear on frame 2 of my home page's main timeline, and tried adding code for it to unload the swf, to no avail.It seems to me that I can't be the only one who has this problem. Lesson 9 of the Adobe Classroom in a Book definitely implies that this can be done, but doesn't have instruction on how to do it. Can anyone help me or point me in the direction of a good tutorial on communication between swfs?
View 3 Replies
Oct 30, 2011
I am new to AS3, I am creating a gallery and stuck on a place. [URL]. Requirements:
1.) Need a nice loop for loading all thumbs, most important it should be physically separated, should not be looped via code.
2.) When I click on 1st button I must load first 4 thumbnails (which is already loaded), and with 2nd button it must load next 4 thumbnails from xml file, similarly with 3rd.
View 1 Replies
Jun 29, 2009
I am trying to load 2 arrays. The first array is a dynamic navigation menu (linkName). The second array is the corresponding title that is loaded in a dynamic textfield. For example if link1 is clicked I want the dynamic textfield to display title1 from the array if link2 is click display title2 and so on. As of right now the dynamic navigation loads fine I just cant seem to figure out a good way to do this without writing a bunch of if statements. I would like it if the programming assumed the that the length of the title array is always going to be the same length as the link array and it finds the corresponding index.
var linkName:Array=["link1","link2","link3","link4"];
var pageTitles:Array=["title1","title2","title3","title4"];
var menuHolder:Sprite = new Sprite;
addChild(menuHolder);
// loading the navigation bar
[Code] .....
View 2 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
Dec 30, 2008
I have attached two pictures. Basically I am making a website. The main navigation loads in external swf's through a container movie. For this I have used this tutorial : [URL]. What I want to do is- when you rollover the navigation bar, be it the text or the coloured block- I want it to scroll down and reveal the 'sub navigation'. (pic2) It's like a drop down menu but kind of the other way around. Then, when you either rolloff of the navigation bar or click on a menu button, it slides back up to its original state. (Pic1). I have played around and only managed a sloppy version which doesn't work very well, especially when you resize. I think a simple answer to this is if I could get my buttons to work inside a movie clip. I had tried this but then the swfs wouldn't load properly.
View 3 Replies
Feb 5, 2012
[Code].....
I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.
View 4 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 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
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
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
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
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
Sep 18, 2009
I need to load a bunch of images using a for loop looping through xml. This will be called over and over for various groups of images. Memory management is a major concern. In the for loop I create a loader
ActionScript Code:
var thumb_loader:Loader = new Loader();
var thumbContainer:Sprite = new Sprite();
thumb_loader.load (new URLRequest (panelViewer [categoryPanels [indexCategoryPanels][i]].@pathName));
// set the thumb node from xml
thumb_loader.contentLoaderInfo.addEventListener(Event.INIT, thumbLoaded);
thumbContainer.addChild(thumb_loader);
I also add the thumb loader as a child now in the init handler
ActionScript Code:
function thumbLoaded(e:Event):void {
//when all thumbs are loaded I set them alpha to 0 and then to 1, for a nice effect
var thumbTarget:Object = e.target.content;
thumbTarget.alpha = 0;
Tweener.addTween(thumbTarget, { time:1, alpha:1, transition:"easeOutSine"} );
}
The issue I have I keep adding sprites and loaders and this keeps sucking resources this is for an air app that has to run for several days cycling through hundreds of images. How to keep my resources low and load a group of images delete the loaders and then on the next cycle delete the previous group.
View 5 Replies