Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 891
  • Last Modified:

Flash Header that loads different .swf slideshows depending on what section of the site your in.

Hi,

I'm trying to do something for the first time and I have not been able to figure out how to do it.  You can see what I'm working on here:

http://themarquistheater.com/calendar/index.htm

I have two movie targets in the flash header of the site.  I want diffferent .swf slideshows to be loaded depending on what section of the site your currently in.

I've never used LoadMovie in this type of scenario, and I know it has something to do with variables and sections, but I'm confused on how to implement this at the moment.

Thanks so much for any assistance you can provide.  I can make the .fla available if need be.

JB
0
jb1013
Asked:
jb1013
  • 6
  • 6
1 Solution
 
BillystyxCommented:
I think either a more indepth explanation or the fla would help:)

Billystyx
0
 
jb1013Author Commented:
Sorry let me try and be more descriptive.

Here's a link to the .fla
http://www.themarquistheater.com/temp/header.fla

And here's the basic structure of the site

index.htm (includes header.swf)
header.swf

-calendar/index.htm (includes ../header.swf)
-calendar/left.swf
-calendar/right.swf

-contact/index.htm (includes ../header.swf)
-contact/left.swf
-contact/right.swf

-store/index.php (includes ../header.swf)
-store/left.swf
-store/left.swf

-gallery/index.php (includes ../header.swf)
-gallery/left.swf
-gallery/right.swf

-moments/index.php (includes ../header.swf)
-moments/left.swf
-moments/right.swf

So each section of the site has its own left and right .swf files, that need to be loaded by header.swf depending on what section of the site the user is in.

Hope that makes sense, let me know if I can help explain this better in some way.

Thanks for reading!!!

JB
0
 
BillystyxCommented:
Use flashVars in your object tags to send the different info to flash depending on where you are in your site.

Billystyx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jb1013Author Commented:
Can you be a bit more specific, this is the first time I've done anything like this?  Or maybe a link to some documentation that would be useful.  I'm going to check Macromedia and Google for more info, but if you have any other helpful info I'd be grateful.

Thanks,

JB
0
 
BillystyxCommented:
in your html file put something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>flashvar</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="flashvar" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flashvar.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<PARAM NAME=FlashVars VALUE="myVar=Page1"/>****this line is the important one
<embed src="flashvar.swf" FlashVars="myVar=Page1" quality="high" bgcolor="#ffffff"
***and in the one above starting with FlashVars
width="550" height="400" name="flashvar" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

Then in your fla you just need to pass that variable to code
if(myVar=="Page1"){
loadMovie("etcetc.swf");
}else if(

and so on.
Does this help?

Billystyx
0
 
jb1013Author Commented:
Thanks so much Billystyx.

Really appreciate you taking the time to help me out.

JB
0
 
BillystyxCommented:
no worries :)
billystyx
0
 
jb1013Author Commented:
Billystyx,

If your still around, I have not been able to get this solution to work yet.  I'm sure its some small thing I'm doing wrong, and I've just looked at it for too long to figure out what I'm missing.  Here's the if statements that are in Frame 1 of the header.swf

if (_root.slideshow == calendar) {
      left.loadMovie ("calendar_left.swf");
      right.loadMovie ("calendar_right.swf");
      }
else if (_root.slideshow == contact) {
      left.loadMovie ("contact_left.swf");
      right.loadMovie ("contact_right.swf");
      }
else if (_root.slideshow == store) {
      left.loadMovie ("store_left.swf");
      right.loadMovie ("store_right.swf");
      }
else if (_root.slideshow == gallery) {
      left.loadMovie ("gallery_left.swf");
      right.loadMovie ("gallery_right.swf");
      }
else if (_root.slideshow == moments) {
      left.loadMovie ("moments_left.swf");
      right.loadMovie ("moments_right.swf");
      }  // end if

Here's an example of the object tag in the HTML file from the Calendar section.

><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="200">
        <param name="movie" value="../header.swf" />
        <param name="quality" value="high" />
            <param name="bgcolor" value="#800000" />
            <PARAM NAME=FlashVars VALUE="slideshow=calendar"/>
        <embed src="../header.swf" Flashvars="slideshow=calendar" quality="high" bgcolor="#800000" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="760" height="200"></embed>
      </object>

You can download the newest .fla here:

http://www.themarquistheater.com/temp/header.fla

You can see what I'm working on here:

http://www.themarquistheater.com/calendar/index.htm
http://www.themarquistheater.com/moments/index.php

There are only two of the slideshow .swfs up at the moment, the first one and the last one that are called in the if statements.  They are in the same root /www directory of the site that the header.swf file is located.
      left.loadMovie ("calendar_left.swf");
      right.loadMovie ("moments_right.swf");

Kind of odd and I don't know if this will help troubleshoot the problem, but the actual target movie place holders show up on the calendar and moments pages but not the store and gallery pages (which I haven't yet added the FlashVars to the Object Tag).  Also if I run the header .swf locally (not even in a HTML page), the calendar_left.swf loads.

I feel like I'm just a hair away, but I can't for the life of me find what I'm missing.  Your explanation was very good and really helped me understand the theory behind this, but until I can make it work I'm still treading water.

Thanks so much.

JB

0
 
BillystyxCommented:
frame2:
if (_root.level == 2)
{
    var use_level = "../../";
}
else if (_root.level == 0)
{
    var use_level = "";
}
else
{
    var use_level = "../";
} // end if

if (_root.slideshow == calendar) {
      left.loadMovie ("calendar_left.swf");
      right.loadMovie ("calendar_right.swf");
      gotoAndStop(4);
      }
else if (_root.slideshow == contact) {
      left.loadMovie ("contact_left.swf");
      right.loadMovie ("contact_right.swf");
      gotoAndStop(4);
      }
else if (_root.slideshow == store) {
      left.loadMovie ("store_left.swf");
      right.loadMovie ("store_right.swf");
      gotoAndStop(4);
      }
else if (_root.slideshow == gallery) {
      left.loadMovie ("gallery_left.swf");
      right.loadMovie ("gallery_right.swf");
      gotoAndStop(4);
      }
else if (_root.slideshow == moments) {
      left.loadMovie ("moments_left.swf");
      right.loadMovie ("moments_right.swf");
      gotoAndStop(4);
      }  // end if
      

var home = _root.use_level + "index.htm";
var link1 = _root.use_level + "calendar/index.htm";
var link2 = _root.use_level + "contact/index.php";
var link3 = _root.use_level + "store/index.php";
var link4 = _root.use_level + "gallery/index.php";
var link5 = _root.use_level + "moments/index.php";

_root.home_btn.onRollOver = function ()
{
      _root.home_rollover.gotoAndPlay("on");
};
_root.home_btn.onRollOut = function ()
{
      _root.home_rollover.gotoAndStop("off");
};
_root.home_btn.onRelease = function ()
{
    getURL(_root.home, "");
};
frame3:
gotoAndPlay(2);
frmae4:
stop();

Billystyx

you need to loop it until it picks up the variable, and then you don' twant it to keep trying to load, just cut out the remiander of frames if possible.

Hope this helps:)

0
 
jb1013Author Commented:
Makes sense, but its still not working.

I updated the header.fla it here:

http://www.themarquistheater.com/temp/header.fla

Also the two pages that have the FlashVars in the in the HTML are continually looping.
http://www.themarquistheater.com/moments/index.php
http://www.themarquistheater.com/calendar/index.htm

But the pages that dont have the FlashVars added yet make it to the last frame.  I added a white dot so you can tell.
http://www.themarquistheater.com/gallery/index.php

Thanks so much for your help!

JB
0
 
jb1013Author Commented:
I also noticed that the index page of the site (which is currently named temp.htm) is loading the first two movies from the if statements even though I have not assigned
the "slideshow" FlashVar to the HTML object on this page.

if (_root.slideshow == calendar) {
     left.loadMovie ("calendar_left.swf");
     right.loadMovie ("calendar_right.swf");
     gotoAndStop(4);
     }

http://www.themarquistheater.com/temp.htm

I'm definately confused again.

Thanks so much for any assistance you can provide.

JB
0
 
BillystyxCommented:
I have posted something at the new thread.
Hope it helps:)
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21408813.html

Billystyx
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now