Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Using SetInterval To Reload An Xml File


Hi, i have an xml file that is regenerated every 10 mins.



I am trying to use the setinterval to reload my xml file in flash but cant get it to work??



Is what im trying do do possible? or is there a better way of doing it?



Thanks




PHP Code:



xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("stocks.xml");
var origYposition:Number = 200;
_global.indicename = new Array();
_global.currentprice = new Array();
_global.valuechange = new Array();
_global.newLocation = new Array();
_global.cell = new Array();
var nInterval:Number = setInterval(loadXML, 60000);
function loadXML(loaded) {
if (loaded) {
  for (i=0; i<32; i++) {
   _global.indicename.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
   _global.currentprice.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);
   _global.valuechange.push(this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue);
  }
  for (i=0; i<_global.indicename.length; i++) {
   _global.cell = "cell"+i;
   trace("Symbol = "+_global.indicename[i]+" Attached to - "+cell);
   trace("Current Price = "+_global.currentprice[i]);
   trace("Value Change = "+_global.valuechange[i]);
  }
}
}




FlashKit > Flash Help > Flash ActionScript
Posted on: 04-05-2008, 11:40 AM


View Complete Forum Thread with Replies

Sponsored Links:

Using SetInterval To Reload An Xml File
Hi, i have an xml file that is regenerated every 10 mins.

I am trying to use the setinterval to reload my xml file in flash but cant get it to work??

Is what im trying do do possible? or is there a better way of doing it?

Thanks


PHP Code:



xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("stocks.xml");var origYposition:Number = 200;_global.indicename = new Array();_global.currentprice = new Array();_global.valuechange = new Array();_global.newLocation = new Array();_global.cell = new Array();var nInterval:Number = setInterval(loadXML, 60000);function loadXML(loaded) { if (loaded) {  for (i=0; i<32; i++) {   _global.indicename.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);   _global.currentprice.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);   _global.valuechange.push(this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue);  }  for (i=0; i<_global.indicename.length; i++) {   _global.cell = "cell"+i;   trace("Symbol = "+_global.indicename[i]+" Attached to - "+cell);   trace("Current Price = "+_global.currentprice[i]);   trace("Value Change = "+_global.valuechange[i]);  } }} 

View Replies !    View Related
Trying To Reload Data Using SetInterval
Can someone tell me why the attached code will run & refresh as fast as it can for like 5-10 seconds, and then quit all together. All I'm trying to do is reload the data. Can someone tell me what I'm doing wrong?

Thanks,

Scott







Attach Code

rand = Math.floor(Math.random() * 100);
fl_url = "live_flash.php?mid="+mid+"&r="+rand;

time = 5000;
counter = setInterval(reloadPHP(), time, "");

function reloadPHP(){
clearInterval(counter);
sendAndLoad(fl_url, "GET");
loadVariables(fl_url, "_root");
counter = setInterval(reloadPHP(), time, "");
}

View Replies !    View Related
Unexpected Result Of Setinterval After Movie Reload
Hi All,
I have the following code in my movie


Code:
timer = setInterval(fun,100);
function fun(){
....
...
..
}
It works perfectly.
BUT, when I press the F5 of browser in which I'm watching that movie or if I reload that movie, function 'fun' get called twice per 100 milliseconds. It clearly means, after reloading the movie, previous setinterval is not getting flushed/removed from the memory. WHY??? Is it a bug?

I have to write down the folowing code for this to work properly

Code:
this.onUnload = function(){
clearInterval(timer);
}
Any other way to aolve this problem since I dont want to use unload event. (Because even 'unload' event sometimes behaves unexpectedly)

TIA

Mahesh Kokadwar

View Replies !    View Related
SWF File Should Not Reload
Help - I have a website made up of 4 main SWF files which link to each other. Problem is that in Internet Explorer on both Mac & PC, the SWF files don't seem to be cached - ie. I have to wait for them to reload each time I go back to that page. I am using:

if (_framesloaded >= _totalframes) {
gotoAndPlay ("end");
} else {
play();
}

Which should detect whether the movie has loaded or not, and skip the loading routine. The code seems to be right - so does anyone know what the problem might be? Perhaps you have had a similar problem?

Thanks in advance

View Replies !    View Related
Reload An XML File?
It would sure make my life easier if there is a way to reload the XML in an swf. It doesn't seem likley but I thought I would ask. If not, is is possible to reload the same swf back into its container but with new xml? Seems like this would in effect to that same thing. Is it doable? I've been experimenting, but so far I haven't hit it.

Maybe I should ask this too: How does anyone else update a menu with new options? I am using a listbox component and would like to step through a series of options, each one loading a new xml file. I would really like to keep it all in the same container. Currently I am loading new listboxes into new containers and it's getting crazy!

View Replies !    View Related
Reload File Each Visit
Hi,
I've got a txt that I access through a loadvars.
Once the swf has been viewed, changes to the file won't show up on the user's computer because a copy of the old one is in their cache.

How can I make Flash get a fresh copy of the file every visit?

Thanks
Neal

View Replies !    View Related
Reload Loaded File
file = new LoadVars();
file.onLoad = function() {
for (var i in file) {
n++;
list = i.split("|");
combobox.addItem("song "+n+" "+list[0], list[1]);
}
};
file.load("http://www.file.asp");
onChange = function () { screen.loadSound(combobox.getSelectedItem().data, true);};
function populate() {
combobox.removeall();
combobox.addItem(file);???????
}

I am trying to repopulate the combobox with the already loaded asp file. I have tried many other ways and all have failed. Any pointers would be great.

View Replies !    View Related
How To Make SWF To Reload From The Start, Every Time User Reload/revist The Page.
Hi,
How can i make my flash SWF file to reload from the start every time when a user visit the site.

Like i dont want it to be saved in cache, i want to reload it from the start every time, because i have seen that once it is saved into cache, it just starts from the cache when we visit the site. So, i dont want it, i want it to reload again and again from the server whenever user visits.


I used the following meta tag:
<meta http-equiv="pragma" content="no-cache">

But it seems to be not working as the way it should. As when i re-load the page, the preload bar shows 100% loaded.


ANy idea???



Amir

View Replies !    View Related
Reload Variable From Text File
i'm loading a variable from a text file on the server.
that variable in that text file is subject to change.
the problem is that the flash file gets cached by the web browser BUT SEEMINGLY ALSO the variable of the text file on the server.

this means that when i changed the variable in the text file, the variable won't change in my flash file because the old one is cached by the web browser.

how can I ressolve this?

now i'm using:

loadVariablesNum ("welcome.txt", 0);

View Replies !    View Related
Reload/re-read Xml File After Updating
Hi,

I've been collaborating on a game (family feud) that loads an external xml file containing questions and answers, (in this case, it's the "fast money round"). The game is intended to be run as a projector file but it'd be great to have the same code work in an .swf file as well. I'm using CS3 to code.

In the interest of providing a more fluid feel to the game, I want to edit an xml file using NotePad or some other XML editor, save it and have the data (answers) automatically updated for display ingame so that the .exe doesn't have to be restarted.

I guess it could be compared to using a live feed, so how would I go about getting my updated answers every XX seconds?

I'm not a CS3 programmer and I don't want to make this any more difficult than it needs to be. I'm unsure as to what the best course of action is. Do I reload the entire xml file or can I just reload the answers as they're updated?

Here's what we're using to load the question and answer file:

Code:
var xmlRequest:URLRequest = new URLRequest("bonusquestions.xml");
var myLoader:URLLoader = new URLLoader(xmlRequest);
var questions:XML;

myLoader.addEventListener("complete", xmlLoaded);


For those who'd like to take a look, the project files are available for download at:
http://www.theblog.ca/wp-content/upl...opers_full.zip

The link to the post regarding the game is at:
http://www.theblog.ca/familyfeud

Any assistance would be appreciated.

View Replies !    View Related
[Q] Any Way To Reload The SWF File In A Clean State?
Howdy...

Maybe this is not possible unless you are actually reloading the HTML page, but I thought that I'd ask anyways...

Is there any way to refresh the SWF file without reloading the HTML page???
I normally use loadMovieNum("my.swf", 0); to reload the SWF if I have to, but the problem with this is that it does not guarantee the clean restart...

See this sample code as an example...

PHP Code:



reloadCount = 0;

this.onEnterFrame = function ()
{
    time_txt.text = getTimer();
    reload_txt.text = reloadCount;
}

this.click_mc.onPress = function ()
{
    loadMovieNum("reload.swf", 0);
    reloadCount++;
    reload_txt.text = reloadCount;





I have a variable called reloadCount which seems like it is being cleared as the SWF file reloads, but the onEnterFrame keeps running... I don't know if there is any other variable/listener alive when the SWF gets reloaded...

Any idea how to achieve that???

Oh... FMX and FMX 2004 does that... No idea on F8...

View Replies !    View Related
Forcing A Browser To Reload Swf File
It's probably simple to do but I haven't been successfull locating a howto regarding how to get a browser to reload a swf file after like an update. Any ideas? Thanks.

View Replies !    View Related
Random Changing Swf File On Page Reload
I really hope someone can help here... and quickly if possible.
I have a HTML page with a simple flash animation loop playing at the bottom. I want to make this flash movie randomly change each time the page is reloaded or refreshed...

Is this something I need to code in an empty Flash movie? Or in the actual HTML page itself?

Cheers,

View Replies !    View Related
Change Swf File On Page On Reload Or In Background
Does anyone know how can i get an image in a swf file to change when user simply reloads page. any help much appreciated. - thank you!

View Replies !    View Related
MS Explorer Reload And Unload Event In Swf File
Hi,

Case 1: Does anyone knows how can I to avoid that Microsoft Internet Explorer reloads page when I use the getUrl command in my flash movie? (I have version 6 iexplore and i did not try with another one yet, but i need it in all versions). I did try to use loadVariables methos, but i haven't results.

Case 2: In addition somebody knows how can I handle the unload movie event of the entire swf?

Reasons:
Case 1: I need to open another window from my swf movie.
Case 2: I need to set free a space in a room when user leaves (including when closes the browser)

View Replies !    View Related
Save Data To External Txt File And Reload
Hi dears,

I want to save my variables to txt or doc files.

and then I want to load datas from external txt files.

If anyone get solution to this thread, Please help to me.


Note;

This is for standalone player not for web use

thanks in advance,

Regards,

Suresh J

View Replies !    View Related
Dynamic Image Reload Is Cached. Need Fresh Reload.
I'm calling a basic image from the web, but the image is constantly updated. When the end user clicks to reload, it displays the same cached image. How to I force it to reach out and get the updated image?

Not too savy with actionscript yet and could use some help.
FYI, this is a standalone exe flash file, not a browser embeded movie.
Thanks in advance.

View Replies !    View Related
Sending Variable To External File On Page Reload?
Is is possible for flash to send a variable to an external file on page reload?
I have a flash menu on my site...when browser loads the new page, I'd like to have the menu item (say latest news) highlighted for that page, but since its also realoding the flash, I'm not sure how it would know to highlight the menu item. I'm guessing that some sort of variable would be the solution.
Any help is appreciated!
Thanks!

View Replies !    View Related
Flv As A Banner : Avoiding Flv Reload On Page Reload
Hello.. I'm tring to create a looping sfw banner containig a looping playst of flv on my new website...
I think I understoode how to do that..
My biggest problem, is that I wish the flv avoid reloading every time that the page is changed..
I don't know if I ì ve been clear...
I'm sure that checking this page will help understanding the problem:

www.kurageart.eu

hope you can help!
thank you

View Replies !    View Related
Vars From Text File, Not Updating Changes, Must Clear Cache, Then Reload Page.
I am having some cache problems.

The code below is for updating a users profile,
When a user makes changes,
he/she is redirected back to the SWF where the editor is,
but the values remain the same.
They might think it did'nt update their changes,
but it did.

I tried using:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
in the html where the swf is embeded,
but it did not work.

Is there some sort of cache control,
or a way to reload the new vars using actionScript.

I'm open to any ideas,
The code is below. Thanks.


Code:
stop();

loadText = new LoadVars();
loadText.load("../members/" + _root.username + "/profile.txt");
loadText.onLoad = function() {
genderSex.text = this.genderSex;
DOB.text = this.DOB;
location.text = this.location;
aboutMe.text = this.aboutMe;
};

function updateSex(){
this.genderSex.text = genderSex_drop.getSelectedItem().label;
}

//
function editProfile(){
username = _root.username;
password = _root.password;
genderSex = this.genderSex.text;
dob = this.DOB.text;
location = this.location.text;
aboutMe = this.aboutMe.text;
//secret = "HIDDEN";
getURL ("../change.cgi", "", "POST");
};

View Replies !    View Related
SetInterval For Jpg Animation Ext.file
I've got this code which doesn't work. I had the same basis with buttons
working, but by changing it to a 'no button' mode it won't work anymore.
I cannot see why....

Does anybody see why?
code:
reportVars = new LoadVars();

reportVars.onLoad = function(succes) {
if (succes) {
Index = -1;
show_next_image();
mc_info.play();
}
loadMovie(this["image"+(Index)], imageHolder0);
_text.text = this._text;
_title.text = this._title;
};

reportVars.load("reports/rotterdam2.txt");

setInterval(show_next_image, 5000)
{
// call function every 5 seconds

function show_next_image() {
if (Index<reportVars.aantalimages-1) {
Index++;
// need to get the image name from the loadVars object
image_name = eval("reportVars.image"+Index);
loadMovie(image_name, imageHolder0);
update_counter();
}
}
}

function update_counter() {
mc_info.dInfo_1en2.dInfo_holder1.dInfo.text = (Index)+"/"+reportVars.aantalimages;
}

View Replies !    View Related
SetInterval Problem With XML File
hi

I am using the code below to build a slideshow. I don't want it to have any buttons, after a 5 second delay on each image (read from an XML file), I want it to go to the next image...and the repeat.

However, I'm having a problem with the delay of 5 seconds. So far it works for the 1st image, and then doesn't work for the following images. I think it's a problem of logic, of where to call things from etc, but I could really do with some help on this!

Obviously the problem is around the
intervalID = setInterval(nextImage,5000);


Any help would be great. Cheers.

The code is:

Code:

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
trace("load error");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("generic_images.xml");
var intervalID;


p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
} else {
intervalID = setInterval(nextImage,5000);
}//end if
}
};


function nextImage() {

if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
trace(image[p]);
clearInterval(intervalID);
}
}
}

function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);

}
}

View Replies !    View Related
External As File And SetInterval
hi, im including an external as file for the first time to organize the functions i normally use, however whenever i use a setInterval it wont loop, ill try to explain more clearly:

for example, i have this code in a document for a slide show:


ActionScript Code:
#include "libreria1.as" var arr = new Array; arr[0] = 'pic1.jpg';arr[1] = 'pic2.jpg';arr[2] = 'pic3.jpg'; slide_show(arr, _root.prueba, 5);


then in the "libreria.as" file i have this code:


ActionScript Code:
function slide_show(lista:Array, clip:MovieClip, time:Number) { var i = new Number; var len = new Number; i = 0; len = lista.length; function loadcurrent(lista:Array, clip:MovieClip, len:Number, i:Number) {  trace(clip+' '+lista+' '+' '+len+' '+i);  clip.loadMovie(lista[i]);  i += 1;  if(i >= len)   i = 0; } intervalo = setInterval(loadcurrent(lista,clip,len,i),time*1000);}


if i execute i get this output:

_level0.prueba 1.jpg,2.jpg,3.jpg 3 0

wich is correct, but it wont show anything more, wich im assuming it only executes the function called by the interval once and wont do it again after the interval time

hope i made it clear, any idea? didnt find this particular problem googling neither in the forums here

thanks a lot for your time kirupians

View Replies !    View Related
SetInterval( Creatin And Killing It) With File
Hi evry1,

I'm have some troubles to create a simple effect.

When mouse roll over a button (actually, it's a movie clip), A blue box grows until it takes 100% of yscale.

I'm trying to use set interval because I wanna use this effects with more buttons.
I wanna to kill this interval after the blue box get 100%.
Can you help me




PHP Code:



bx_blue._yscale = 0;
area_menu_01.onRollOver = function(intervalo) {
    trace ("param -> " + intervalo);
    up_blue = function(intervalo) {
        bx_blue._yscale++;
        trace ("before if " + intervalo);
        if (bx_blue._yscale++ >= 100){
             bx_blue._yscale = 100;
             trace (this.intervalo)
             clearInterval(intervalo);
        }
    }
    this.intervalo_up = setInterval(up_blue,10,this.intervalo_up)
    
    
}

View Replies !    View Related
Possible To "reload" Flash File? (Having Webcam Issues)
So I ran into this problem where if you are broadcasting a stream from your webcam to Flash Media Server, and you unplug your camera, it locks up on you.

I have a FPS checker that catches when you've unplugged your camera, and it stops all connections and detaches audio/video from the stream. After that, when the script attempts to reload the page or record again, the browser crashes.

Is it possible to reload JUST the flash file from within actionscript? Also, might there be an issue in how I'm detaching the audio/video from the video component? (I use myvid.attachAudio(null); and then i close the stream.

View Replies !    View Related
SetInterval Won't Clear In Class File - Should Be A Quick Fix?
So it's been two day's of almost pulling my hair out... Here's the problem

I wrote a slideshow class file. Everything works perfectly when on a standalone .swf

However, when loaded into a new movie it still works great but if you navigate to another section of the site, which in this case unloads the slideshow .swf from the holder mc and loads a new section into it, and then go back to slideshow (unloads other section and loads slideshow.swf) it starts to act all screwy...

So I've came to the conclusion that it has to do with the setInterval that I used in it. There is a method that pauses the image with setInterval and then calls the fadeOut method (which goes on to the next image). It seems to only act wierd if I navigate away from this section while the image is still (which means the setInterval is doing it's thing and is not cleared).

Is there a way to fix this??? I've tried a bunch of different things and none seem to work

here is a snippet from my class:


Code:
private function holdSlide ():Void
{
var tempObj:Object = this;
var holdInterval = setInterval(pauseSlideshow, __delay);
// _global.setTimeout (pauseSlideshow, __delay);
function pauseSlideshow() {
clearInterval(holdInterval);
tempObj.nextImage();
}
}

View Replies !    View Related
Custom Objects And Internal SetInterval Loops -> A Problem Stopping The SetInterval
Let's say I had a class like this:


PHP Code:



var someVar = new Widget();

function Widget() {
    // Some variables, etc...
    this.int_someCommand = 0;
    // Activate the function on instantiation
    this.someCommand();
};

Widget.prototype.someCommand = function() {
    clearInterval(this.int_someCommand);
    this.int_someCommand = setInterval(this, 'someCommandLoop', 50);
};
Widget.prototype.someCommandLoop = function() {
    trace("THIS IS A WIDGET LOOP!");
}; 




...now, I was always under the impression that if you delete an object in Flash, the setInterval loops associated with it would die as well. But when I try to:


PHP Code:



// At some other point in my timeline...
delete someVar; 




or:


PHP Code:



someVar = new Object(); 




...the original loop is still running (I can tell just by reading the trace). How do I go about properly terminating a setInterval loop inside an Object without having to call a clearInterval()? Or is a clearInterval() the only way?

Thanks.

View Replies !    View Related
Tween Class, Does It Use Setinterval? Getting Strange Setinterval Type Problem
I have a gallery with small thumbnails. Upon clicking a thumbnail, I am using the Tween class to pull clips from an array and fade them between each other, loading the clips into a container.

When I click the thumbnail it loads the .swf fine and plays the Tween Class animation just as it's supposed to, however if I click any other thumbnail and go back to that first one the timing gets totally screwed up and the fades get jittery and overlap each other, much like it does with setInterval if you don't clear the intervals.

Is there a way to clear the Tween Class? Does it's timer run on setInterval?


This is the code I am using for the tween class


Thanks!


Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

//content movieclips put into an array
var mcArray:Array = new Array(content1, content2);
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}

// tween class has something called "OnEnterFrameBeacon" and it is added to the stage
// when we import the as file, so I wanted to get rid of it.
var n:Number = 0;

function playFades() {
if (n<mcArray.length) {
var tween_handler1:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 0, 100, 1, true);
tween_handler1.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
//n++;
var tween_handler2:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 100, 0, 3.5, true);
tween_handler2.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
n++;
playFades();
};
};
} else {
n = 0;
playFades();
}
}
playFades();

View Replies !    View Related
Reload All
how do i reload the entire flash? i mean i was pretty deep into loading and reloading movies and now the easiest way i can imagine is to restart the entire thing (from cache)

thanks 4 advice
dirty

View Replies !    View Related
Reload Mc
How do I stop a movie (external swf) that has been loaded into a target from reloading everytime I enter that frame.

Anyone????

View Replies !    View Related
Reload MC
I hope this isn't too confusing. I have a slideshow that loads when you click one of the buttons. The slideshow doesn't start until a button is clicked (goes to frame "modern" on the timeline). The first time a button is click, it works fine. When a second button is click, the movie clip that the slideshow is in doesn't load the new variables. It keeps playing the first slideshow and always returns the 1st variable (variables category2 and i2 in code below). Is there a way I can have the variables and/or movie clip reload when a different button is clicked?

Here's the code in the movie clip:

function selectFade() {
if (_root.playFade eq "2") {
trace("AUTOPLAY IS ON!");
trace("Pictures will start changing in 2 seconds...");
this.autoPlay = true;
setTimerCtrl();
// Picture will change in 5 seconds, as set in the setTimerCtrl() function.
startFade();
} else {
trace("AUTOPLAY IS OFF!");
this.autoPlay = false;
clearInterval(intervalID);
// Clear the interval created from the auto state.
}
}

function startFade() {
fscommand("allowscale", "false");
_root.mcFadeImage.pathToPics = "images/";
category2 = _root.categoryType2;
i2 = _root.categoryNumber2;


Here's the button code:

_root.categoryNumber2 = _root.categoryNumber;
_root.categoryType2 = _root.categoryType;
_root.selectFade();
_root.gotoAndPlay("modern"); //This is the frame the movie clip starts

View Replies !    View Related
Reload An Mc
hey, is there a simple line of coding or something that will reload an mc?

View Replies !    View Related
How Do I Reload A Swf Using The Same Swf ?
Im trying to find a function that can reload the entire swf when a button is pressed. ( mainly for a button that would say "play again" after a game has ended...in order to avoid having to reset all variables )

Its only one swf without any other swf files nesting inside it. It would have to be a function that "self reloads".

Any ideas ?

View Replies !    View Related
Xml Reload
Hello,
I have an XML file that has all site content in it. I am calling the items as a sub nav and multiple categories. Each time it loads the other categories stay in the sub nav. It is not reloading the category names. How would I refresh the XML file so it would reload each time pressed? Would really appreciate the help on this.

I have included the swf file so you can see where it happens. It occurs in the GALLERY section. When you click GALLERY, there is a main nav on the left that comes out. When a item is clicked it loads new sub categories. Then when click BACK TO LIST it keeps the previous categories on the list. It is not refreshing the XML file. The sub categories stay under the main categories. Is there a code I can put to reload XML or data for GALLERY section?

I have included AS code below for the XML.

PHP Code:



function buildSite(){
    
    
    loadSiteInfo = function () {
        siteInfoXML = new XML();
        siteInfoXML.ignoreWhite = true;
        siteInfoXML.onLoad = function(success) {
            if (success) {
                staffText._visible = 1;
                careerText._visible = 1;
                staffLength = this.firstChild.childNodes[0].childNodes.length;
                staffArray = new Array();
                clientLength = this.firstChild.childNodes[1].childNodes.length;
                clientArray = new Array();
                careerLength = this.firstChild.childNodes[2].childNodes.length;
                careerArray = new Array();
                galleryLength = this.firstChild.childNodes[3].childNodes.length;
                galleryArray = new Array();
                homepicArray = new Array();
                homeLength = this.firstChild.childNodes[4].childNodes.length;
                for (i=0;i<staffLength;i++){
                    staffArray[i] = new Array();
                    staffArray[i].name = this.firstChild.childNodes[0].childNodes[i].attributes.name;
                    staffArray[i].title = this.firstChild.childNodes[0].childNodes[i].attributes.title;
                    staffArray[i].email = this.firstChild.childNodes[0].childNodes[i].attributes.email;
                    staffArray[i].image = this.firstChild.childNodes[0].childNodes[i].attributes.image;
                    staffArray[i].description = this.firstChild.childNodes[0].childNodes[i].childNodes;
                    trace(staffArray[i].description);
                }    
                
                for (i=0;i<clientLength;i++){
                    clientArray[i] = new Array();
                    clientArray[i].title = this.firstChild.childNodes[1].childNodes[i].attributes.type;
                    projectsLength = this.firstChild.childNodes[1].childNodes[i].childNodes.length;
                    for(j=0;j<projectsLength;j++){
                        clientArray[i][j] = new Array();
                        clientArray[i][j].name = this.firstChild.childNodes[1].childNodes[i].childNodes[j].attributes.name;
                        
                    }
                }
                
                for (i=0;i<careerLength;i++){
                    careerArray[i] = new Array();
                    careerArray[i].title = this.firstChild.childNodes[2].childNodes[i].attributes.title;
                    careerArray[i].category = this.firstChild.childNodes[2].childNodes[i].attributes.category;
                    careerArray[i].location = this.firstChild.childNodes[2].childNodes[i].attributes.location;
                    careerArray[i].job_no = this.firstChild.childNodes[2].childNodes[i].attributes.job_no;
                    careerArray[i].salary = this.firstChild.childNodes[2].childNodes[i].attributes.salary;
                    careerArray[i].description = this.firstChild.childNodes[2].childNodes[i].childNodes[0].childNodes;
                    careerArray[i].qualifications = this.firstChild.childNodes[2].childNodes[i].childNodes[1].childNodes;
                    careerArray[i].examination = this.firstChild.childNodes[2].childNodes[i].childNodes[2].childNodes;
                    
                }
                
                for (i=0;i<galleryLength;i++){
                    galleryArray[i] = new Array();
                    galleryArray[i].category = this.firstChild.childNodes[3].childNodes[i].attributes.category;
                    projectsLength = this.firstChild.childNodes[3].childNodes[i].childNodes.length;
                    for(j=0;j<projectsLength;j++){
                        galleryArray[i][j] = new Array();
                        galleryArray[i][j].name = this.firstChild.childNodes[3].childNodes[i].childNodes[j].attributes.name;
                        galleryArray[i][j].client = this.firstChild.childNodes[3].childNodes[i].childNodes[j].attributes.client;
                        galleryArray[i][j].sq_feet = this.firstChild.childNodes[3].childNodes[i].childNodes[j].attributes.sq_feet;
                        galleryArray[i][j].city = this.firstChild.childNodes[3].childNodes[i].childNodes[j].attributes.city;
                        galleryArray[i][j].type = this.firstChild.childNodes[3].childNodes[i].childNodes[j].attributes.type;
                        galleryArray[i][j].description = stripCommas(this.firstChild.childNodes[3].childNodes[i].childNodes[j].childNodes[0].childNodes);
                        photosLength = this.firstChild.childNodes[3].childNodes[i].childNodes[j].childNodes[1].childNodes.length;
                        for(p=0;p<photosLength;p++){
                            galleryArray[i][j][p] = new Array();
                            galleryArray[i][j][p].photo = this.firstChild.childNodes[3].childNodes[i].childNodes[j].childNodes[1].childNodes[p].attributes.url;
                            galleryArray[i][j][p].thumb = this.firstChild.childNodes[3].childNodes[i].childNodes[j].childNodes[1].childNodes[p].attributes.thumb;
                        }
                        
                    }
                }
                
                for (i=0;i<homeLength;i++){
                    homepicArray[i] = String(this.firstChild.childNodes[4].childNodes[i].attributes.path);
                }
                trace("homepicArray "+homepicArray);
            }
            intro_mc.play();
            
            openSection("overview");
            
        }
        siteInfoXML.load("siteinfo.xml");
    }
    loadSiteInfo();




}


buildSite();



function openSection(newSection) {
    _root.main.nav[sectionOn].gotoAndStop("off");
    _root.main.nav[newSection].gotoAndStop("on");
    
    _root.main[newSection]._alpha = 0;
    nextDepth = main.getNextHighestDepth();
    _root.main[newSection].swapDepths(nextDepth);
    nextDepth = main.getNextHighestDepth();
    _root.main.divs.swapDepths(nextDepth);
    _root.main.loader.swapDepths(nextDepth);
    
    if (newSection=="staff"){
        
        _root.main.staff.side_nav.side_nav_text.text="Worked!";
        
    }
    if (sectionOn!=newSection){
        _root.main[sectionOn].gotoAndPlay("off");
        _root.main.boiler.gotoAndPlay(sectionOn+"off");
    }
    myTarget = _root.main[newSection];

    var fadeIn = new Tween(myTarget, "_alpha", Regular.easeIn, 0, 100, 0.3, true);
    fadeIn.onMotionFinished = function() {
        if (sectionOn!=newSection){
            _root.main[newSection].gotoAndStop("build");
            _root.main[sectionOn]._alpha = 0;
            sectionOn = newSection;
        }
    }
    





CODE FOR GALLERY

PHP Code:



function buildGallery() {
    sideNavCategoryOn=-1;
    galleryCategoryOn=0;
    galleryProjectOn=0;
    galleryNum=galleryArray.length;
    
    main.gallery.side_nav.back.gotoAndStop("off");
    
    for (i=0;i<galleryNum;i++){
        main.gallery.side_nav.side_nav_text.attachMovie("side_nav_item_gallery", "side_nav_item"+i, i);
        main.gallery.side_nav.side_nav_text["side_nav_item"+i]._y=i*17;
        main.gallery.side_nav.side_nav_text["side_nav_item"+i].myNum=i;
        main.gallery.side_nav.side_nav_text["side_nav_item"+i].myText=galleryArray[i].category;
    }
    
    
    slideshowNum=1;
    
    var my_mcl1:MovieClipLoader = new MovieClipLoader();
    var my_mcl2:MovieClipLoader = new MovieClipLoader();
    var mclListener1:Object = new Object();
    var mclListener2:Object = new Object();
    my_mcl1.addListener(mclListener1);
    my_mcl2.addListener(mclListener2);
    
    mclListener1.onLoadInit = function(mc:MovieClip):Void {
        my_mcl2.loadClip("images/gallery.jpg", "main.gallery.slideshow_container.slideshow1.pic2");
    }
    
    mclListener2.onLoadInit = function(mc:MovieClip):Void {
        main.gallery.gotoAndPlay("on");
        main.boiler.gotoAndPlay("galleryOn");
        main.gallery.slideshow_container.slideshow1.gotoAndPlay("on");
        
    }
    
    main.gallery.slideshow_container.attachMovie("slideshow", "slideshow1", 1);
    my_mcl1.loadClip("images/gallery.jpg", "main.gallery.slideshow_container.slideshow1.pic1");
}


function openGalleryCategory(categoryNum) {
    
    for (i=0;i<galleryNum;i++){
        main.gallery.side_nav.side_nav_text["side_nav_item"+i].removeMovieClip();
    }
    
    galleryNum=galleryArray[categoryNum].length;
    
    for (i=0;i<galleryNum;i++){
        main.gallery.side_nav.side_nav_text.attachMovie("side_nav_item_gallery_inner", "side_nav_item"+i, i);
        main.gallery.side_nav.side_nav_text["side_nav_item"+i]._y=i*17;
        main.gallery.side_nav.side_nav_text["side_nav_item"+i].myNum=i;
        main.gallery.side_nav.side_nav_text["side_nav_item"+i].myText=galleryArray[categoryNum][i].name;
        
    }
    
    main.gallery.side_nav.back.gotoAndStop("on");
    
    numThumbs=galleryArray[galleryCategoryOn][galleryProjectOn].length;
    
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    var mclListener:Object = new Object();
    my_mcl.addListener(mclListener);
    
    i=0;
    itemsLoaded=0;
    
    
    mclListener.onLoadInit = function(mc:MovieClip):Void {
        i++;
        itemsLoaded++;
        if (i<numThumbs){
            nextThumb();
        }
        else if (i>=numThumbs){
            loadFirstPic();
        }
    }
    
    
    function nextThumb(){
        main.gallery.thumbs.attachMovie("thumb", "thumb"+i, i);
        main.gallery.thumbs["thumb"+i]._y=i*158;
        main.gallery.thumbs["thumb"+i].myNum=i;
        my_mcl.loadClip(galleryArray[galleryCategoryOn][galleryProjectOn][i].thumb, "main.gallery.thumbs.thumb"+i+".pic");
        
    }
    
    function loadFirstPic(){
        var my_mcl:MovieClipLoader = new MovieClipLoader();
        var mclListener:Object = new Object();
        my_mcl.addListener(mclListener);
        
        mclListener.onLoadInit = function(mc:MovieClip):Void {
            main.gallery.gotoAndPlay("openDetail");
            main.gallery.detail_viewer["detail_pic"+detailPicOn].gotoAndPlay("on");
            timer = setInterval(checkScroll, 1);
        }
        
        detailPicOn=0;
        
        nextDepth=main.gallery.detail_viewer.getNextHighestDepth();
        
        main.gallery.detail_viewer.attachMovie("detail_pic", "detail_pic"+detailPicOn, nextDepth);
        my_mcl.loadClip(galleryArray[galleryCategoryOn][galleryProjectOn][0].photo, "main.gallery.detail_viewer.detail_pic"+detailPicOn+".pic");
        
        
    }
    
    nextThumb();
    


View Replies !    View Related
Always Need To Reload 9
I have IMac POWER PC G4 OS X 10.3.9
Solutions have been posted for same NEED TO RELOAD PROBLEM for INTEL iMacs, but not for PC iMacs.

I received a solution from JibJab tech that temporarily works on Firefox: (1) clear cache from Firefox browser using Tools; (2) Close all browsers; (3) Install Flash Player 9; (4) clear cookies
But I have to repeat this procedure everytime I shut down and start up again.

I generally prefer to use Firefox as browser, but have Safari (older version) and Explorer built-in. Also Netscape seems to be built-in, but never use it. I have the same problem with Safari and Explorer.

I am not a particularly sophisticated user. I just want to be able to enjoy the internet using Quicktime and Flash Player without problems.

HELP!!

dlinma

View Replies !    View Related
Reload Swf
Hai!
Does anybody know how i can make sure that my swf file is reloaded everytime someone visit the page!
I put <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1"> in the HTML page but this doesn't work!

View Replies !    View Related
How Not To Reload?
I was talking to someone about a full Flash site, and they wanted to know if there is a way to check if a movie is loaded; and if the navigation button for that moive is pressed, to not load it again.

I looked through the AS library and didn't really see anything that would pertain.

Any ideas?

For reference, he said he made the site basically following the "Full site" tutorial from here.

View Replies !    View Related
Reload
I am having alot of trouble on a reload script i tried like 6 times with every way i know I just dont seemt o get it right.

Any one have scripts for it.

Please not the one from WB2k Only cause it dont workj for the enies only for the sound and so it odnn shoyany animation it still kills the guy even if you dident reload.

So anyone have ideas.

View Replies !    View Related
Reload Xml?
Hi, how do I reload an xml file?

This is what I have so far:

import flash.display.MovieClip;

var holder_mc:Holder;
var xml:XML;
var xmlList:XMLList;
var item:Item;
var loader:URLLoader = new URLLoader();
var url:URLRequest = new URLRequest("***");

loader.addEventListener(Event.COMPLETE, showItem);

function reload(event:MouseEvent):void
{
removeChild(holder_mc);
loader.load(url);
}

function showItem(e:Event):void
{
holder_mc = new Holder();
holder_mc.x = 34;
holder_mc.y = 70;
addChild(holder_mc);


xml = new XML(e.target.data);
xmlList = xml.channel.item;

for (var i:uint = 0; i < 10; i++)
{
stat_txt.text = "tekst" + i;
item = new Item();
item.y = i * item.height;
holder_mc.addChild(item);

item.title_txt.text = xmlList.title.text()[i];
item.adresse = xmlList.link.text()[i];

item.addEventListener(MouseEvent.MOUSE_OVER, over);
item.addEventListener(MouseEvent.MOUSE_OUT, out);
item.addEventListener(MouseEvent.CLICK, goto);

}
}

loader.load(url);


I'm just removing the holder_mc loads the url again. Not working. Any suggestions?

View Replies !    View Related
Reload Swf
Hai!
Does anybody know how i can make sure that my swf file is reloaded everytime someone visit the page!
I put <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1"> in the HTML page but this doesn't work!

View Replies !    View Related
HELP How Do I Reload W/ Flash
I am attempting to finish up a Interactive Campus Map, however I am unable to figure out how to add a refresh button to the page, I realize that the browser provides one but I'd like to add one to the map so that the page can be reset in a Flash Player. I need the equlivient of a javascript Refresh Page like this or something [ history.go(0) ]. If you have any Ideas let me know. Also if you like to look at peoples work and give suggestions then plaes check out the map. It's really still beta but that will change over the weekend.

<http://wwwstage.valpo.edu/maps/flash>


Thank you in advance

View Replies !    View Related
Force Reload
I was wondering if any one knows how to force the user to reload the SWF file. Right now they don't so if i update the site they will not reload the site.. Instead they will just use the SWF file that was stored on the users computer

View Replies !    View Related
How Can I Make A Gun Reload?
I know how to make the gun shoot but I don't know how to desactivate shooting when it's reloading...

Please answer me...

View Replies !    View Related
Reload A Movie
hi there

how can i on(release) reload a movieclip?

hope you can help....
jesper

View Replies !    View Related
Unexpected Mc Reload. HELP
I have a masked mc that I have scripted to goto and stop frame 2 so as the mask tweens, it appears to reveal the mc.
As the last frame of the mask tween loads, it also forces the masked mc to reload and reset to frame 1.

I can't figure out why or how to correct this issue.

Anyone experience this?
any ideas?

View Replies !    View Related
Reload To Different Frame
My problem is that i have an intro for a site which then goes on to a navigation menu

once a link has been pressed it goes on to a html page

however, the client doesn't want the navigation menu from the intro to appear anywhere else on the site, despite the usability problems

the client would like it that once pressed back to the intro page that it goes straight to the navigation section of the movie rather thna play the whole movie again!

i've seen this done before, but haven't a clue what the script is!

any help would be appreciated

the link is here

View Replies !    View Related
Browser Reload
Is there an actionscript to reload the web browser page.

Example

Scene 1

Button "reload page"

action = click button to reload html page.

Any other option besides loading the page itself?

View Replies !    View Related
Reload Flash?
I am having trouble with stopping a level1 movie from level2 on a particular project. I know this worked on other projects, does this sound like I need to re-load flash? It seems to be ignoring the button script

on (release) {
_level1.Stop();
}


Seems simple enough, I have never had to reload Flash before.

View Replies !    View Related
How To Prevent Reload
i have a two-frame website where one frame is Flash and the other is HTML content. When the user does a window refresh, the Flash movie loses the current state. Is there a way to prevent the refresh from happening in the Flash frame?

(maybe intercept the reload event somehow?)

View Replies !    View Related
How Not To Reload Swf When Going To A New Page?
I have a flash navigation system in my html pages. I was wondering if there is any way for the swf to keep its state when i go to different pages? I know I can do it with frames, but I don't want to use frames. Everytime i click on a link in one of my pages the swf plays from the begining and I lose all the variables I passed to the dynamic text box's.

Please Help,
THanks

View Replies !    View Related
Force Reload Of Swf
I need to force a reload of a child swf. I am using the same logic that I use with loading variables, but it doesn't seem to work.

Code:
var rand = random(8564);
loadMovieNum("mymovie.swf?rand", 3);
Any tips on how to accomplish this?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved