Go Back   $5 Script Archive Community Forum > Flash Image Galleries > Fast Gallery
Register Try FlashChat Try FlashBB Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2007, 06:29 PM
blase blase is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Default multiple xml's in 1 swf (read previous topics)

I researched to no avail and need someone's help.

Instead of #include "main.as" I have,

On keyframe 1: #include "print.as"
On keyframe 2: #include "design.as"
On keyframe 3: #include "web.as"

print.as: _root.xmlFile = "printgallery.xml"
design.as: _root.xmlFile = "designgallery.xml"
web.as: _root.xmlFile = "webgallery.xml"

Basically, the flash viewer will only load whichever xml is loaded first. So if I gotoandStop(2) first, then keyframes 2,1, and 3 all will see only designgallery.xml.

I've read about how to clear xml cache, but couldn't find anything helpful.

Please help me so I can stop hitting my head against the monitor.

Thanks,
Blase
Reply With Quote
  #2  
Old 06-14-2007, 10:13 AM
blase blase is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Default link...

Here's an example.

http://www.contactstudios.com/test.html

Click on portfolio, then print design. Close popup then click product design or web design, and the same xml loads. If you click on product or web design first, then its xml loads exclusively.
Reply With Quote
  #3  
Old 06-16-2007, 11:41 PM
klj2000 klj2000 is offline
Moderator
 
Join Date: Sep 2003
Location: Olympia, WA.
Posts: 22,758
Default

The problem I see is that on run time these files get sent to your browser cache. So going to another button to load this is going to pick up the brower cached files and load them first so it's going to keep doing what your showing. Not sure how good you are with flash and xml but it might be easier to just add more code for xml in the flash end and in the xml file and have it reference to certain parts of the xml file to load what you want. Then it's only one xml file. I know it's a bit more work then what you have done but it's the only way I can think of this working and still being able to only need to load one .swf and xml file. It's that or three scripts and renaming the xml files so it will point to those xml files for what you want. What ever seems best for you to work with.
Reply With Quote
  #4  
Old 06-17-2007, 07:22 AM
blase blase is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Default

But I already do use multiple scripts and multiple renamed xml's. I've also tried loading the galleries as multiple external swf's referring to these renamed xml's with the same problem.

There's no way from flash I can just force the browser to recache the xml?
Reply With Quote
  #5  
Old 06-17-2007, 07:25 AM
blase blase is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Default

Or, do you know of how I could get the external swf galleries to load properly into my clip?

Thanks,
Blase
Reply With Quote
  #6  
Old 06-17-2007, 09:22 AM
klj2000 klj2000 is offline
Moderator
 
Join Date: Sep 2003
Location: Olympia, WA.
Posts: 22,758
Default

Ok renaming the xml files is one thing but your still using the same swf file. If you were to have three scripts with this same .swf file name it's still going to load that one .swf file each time. You might consider renaming the .swf files to different names and edit the object code to make sure the two paths for these also point to the corect .swf file name. That way there isn't any reason to worry about the browser cache then and it would load it's own swf and xml file for each link.
Reply With Quote
  #7  
Old 06-17-2007, 02:52 PM
blase blase is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Default

No, I have 3 separate swf files too with 3 different .as files referencing 3 different xml files.

Although maybe I'm simply not referencing them right. I'm trying to load them into a movieclip at _root.level but can only get them to load at _root. In the process of doing it wrong, I'm experiencing the same symptoms as the other way.

Thanks for the replies,
Blase
Reply With Quote
  #8  
Old 06-17-2007, 08:06 PM
klj2000 klj2000 is offline
Moderator
 
Join Date: Sep 2003
Location: Olympia, WA.
Posts: 22,758
Default

The main swf will always control the root but you may want to play with the lock root setup. This will kind of explain how it works:

http://livedocs.adobe.com/flash/9.0/...0001937.ht ml
Reply With Quote
  #9  
Old 06-11-2008, 11:29 PM
symphy symphy is offline
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Quote:
Originally Posted by blase View Post
No, I have 3 separate swf files too with 3 different .as files referencing 3 different xml files.
I've having the same troubles -- it almost seems random whether it works or doesn't -- if you try it enough times, it eventually realizes you're talking about a different swf and xml, but it's cache-y somehow.

I was able to "fix" the problem locally by loading, then unloading, then reloading the new swfs in successive frames. But alas, on the server, it doesn't work as reliably. Not sure why.

Did you ever figure out what to do? I've been working on it nearly 6 hours straight and am baffled that Flash lacks the easy ability to just "clear all xml data".
Reply With Quote
  #10  
Old 07-01-2008, 04:50 PM
symphy symphy is offline
Junior Member
 
Join Date: May 2007
Posts: 29
Default

By the way -- I fixed this a bit ago.

In main.as, for each gallery, I replaced this:


Code:
if(_root.xmlFile == undefined)
{
	_root.xmlFile = "galleryname.xml"
}
With this:


Code:
_root.xmlFile = "galleryname.xml"
See what must have been happening?

I load the first gallery, say, abstractgallery.swf, which loads abstractgallery.xml as well, right? Works fine. Then I click the second gallery, deckpatiogallery.swf, but then it was checking to see if xml was undefined -- AND ONLY THEN would it load the new xml. Since xml still was defined at the time of the actionscript question, it didn't load the new one in, and the second gallery looked like the first.

i.e, in fakecode:

Code:
load gallery1.swf
do we have an xml?
no?
then load gallery1.xml into gallery1.swf
success!

load gallery2
do we have an xml?
yes, it's gallery1.xml
sounds good to me!
load gallery1.xml into gallery2.swf
failure!
Thanks for all your help!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -7. The time now is 11:02 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) 1999-2007 TUFaT.com