Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic loading of Images Flash/xml

Status
Not open for further replies.

WilliamMute007

Programmer
Sep 30, 2007
116
GB
Can some please try to assist me or point me in some sort of direction.

I have about 5 different asp pages. Each one of the pages have a top banner (flash) with about 3-4 images in the flash movie just transiting from one image to another to match the current page the user is on.

i.e say I am on tek-tips.com, the top banner swf should be a generic one about tek-tip (images should be generic).

When I am on Flash forum, the top banner images should now change to show images relative to the section that I am on.


Can anyone help please? :( I think its XML & Flash.

Thanks in advance
 
I sware I saw this the other day but maybe it wasn't on tektips and I'm not home right now so don't have access to any history. You have options :

- you could just make a different swf for each page containing the images for that page
- you could make a different swf for each page that loads from a subfolder of images for that page so the images can just be changed at any time
- you could (as you seem to want to do) have the same swf on every page but read in part of the referrer URI (which you could pass to it in JS also) or using variables set in flash if your site pages are in flash.

If you're sure you want to do it with variables and code etc then I don't have it to hand but the other 2 options negate the need.

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Leozack, thanks for that response. I am more for the option 3. I want to use variables, how would I do this? is it possible to break it down a bit so I can understand it? I am not that advance, actually my realm is php and mysql I dnt really touch flash and xml and the lot so am quiet a novice.

Thanks a million
 
Ah similar position to myself then. Well is your site a flash site or just using a flash banner at the top? If the whole site was flash you'd just use internal variable for what page you were on to decide what folder of images you use in the banner. But if it's just a banner on a page then the banner needs to know what page it's on.

The simplest way would be to pass flashvars to flash from the html where you embed it. Then in flash just use the variable to know what page you're on and load the relevant images.

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Precisely what I am trying to do but dont know how

The simplest way would be to pass flashvars to flash from the html where you embed it. Then in flash just use the variable to know what page you're on and load the relevant images.

The site is not flash, its just the banner... ahh what a pain!

Thanks for your valid input so far...
 
Assuming you use swfobject
then it's as simple as
Code:
<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.addVariable("pageName", "homepage");
   so.write("flashcontent");
</script>
And then in flash you will have a variable called pageName and depending on the value you can load different images. Is that what you're after?

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Wow... Genius on site... I am using SWF object actually. I will try it when i get to my computer tommorow. I looks right so far! So just wondering, how would the swfobject know what asp page I am on? I am just trying to build on someone elses existing code. Thanks a zillion
 
I assume the ASP page knows what page it's on, and the ASP page outputs the html containing the SWFObject call does it not? So I'd imagine it's that simple. I'm more PHP than ASP myself.

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Ok Thanks once more genius.. I will test your suggestion tommorow morning and let you know. Thanks once more
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top