FORUMS: list search recent posts

[AS2.0] adding FlashVars has changed my layout? - Please Help!

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Clint Milner
[AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 8:49:08 am

http://www.alpha-duplication.com/adl_wip
is my new website I'm building which includes a Flash navigation bar on the left side.

As you can see, the sub-menu links in the Data Services section are correct.

On the other links, I've needed to add some flashVar information to the header tags so the menu stays open.
Under Technical Info, if you click on Glossary, you can see that the flashVars are working because the menu stays open, but for some reason, the whole right side is pushed down.
Can anyone view my source and maybe tell me why this might be happening? I've commented out the flashVar JS in the html, and this solves the problem, but I need the flashVars working.

Here is my AS2.0 code:

//FlashVar code
if(_level0.referringPage != null){
var referringPage = _level0.referringPage;
switch(referringPage){
case "about_alpha":
aboutAlpha();
break;
case "print_services":
printServices();
break;
case "technical_info":
technicalInfo();
break;
case "packaging":
packaging();
break;
}

}

Many thanks,
Clint Milner


Return to posts index

Pieter Helsen
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 1:16:04 pm

Not so much an actionscript as a CSS problem. I suck at CSS though ^^ However, try adding a width to the sidebar div, setting it to 276. The thing's not floating correctly...

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

Clint Milner
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 1:24:40 pm

The thing is that it was floating just fine before I added the flashVar javascript.

If I delete, or comment out the flashvar code in the header of the html, the formatting is perfect once again.



Return to posts index


Sam Mattern
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 1:26:55 pm

I had originally used FlashVars on a site I was building. I found it to be a pain in the @ss when doing major updates to the HTML. Instead, you can detect the URL from within flash. You simply use a call like:

var whatPage:String = flash.external.ExternalInterface.call("function(){return window.location.href}").toString();

This will give you a string to work with showing the full URL, ie:
http://www.yourdomainhere.com/about.html

Then I simply use a switch statement to control my movie. All of this is done in the first frame of the movie on a global actions layer. That way you don't have to modify each HTML page. I was playing around with your site and couldn't find a reason that method wouldn't work for you. What is the purpose of the "referring page"?

Looking at your source, I was suprised to see both swfobject and AC_FL_RunContent. I don't use SWFObject, so I would defer to your judgement there.



Return to posts index

Clint Milner
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 1:52:03 pm

The javascript still throws me for a loop, but just doing a bunch of trial and error, I found out that I don't actually need the AC_FL_RunContent. I'm using swfobject because I didn't know how to make it work, and the person who made it work for me did it this way.

http://www.alpha-duplication.com/ADL_WIP has the most recent versions of the pages (that still don't work)

If you look at the source code of any of the pages in the Data Services section, (http://www.alpha-duplication.com/ADL_WIP/mcps.html for example)I've just commented out the flashVar and embeded the swf into the div id="sidebar1"

The links under Technical Info (glossary and fulfilment links) have the code for the FlashVar. As you can see, the code makes the navBar stay open to the Technical Info section, but the div id="maincontent" is pushed below the navBar swf.

I'll resort to trying it your way, but here's the link to my external css sheets - maybe you can see the problem there, but I think it's the javascript.
http://www.alpha-duplication.com/ADL_WIP/Data_Services/DataServicesCSS.css

Thanks guys, hope we can get this figured out.

Clint



Return to posts index

Sam Mattern
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 2:46:32 pm

Another reason I moved away from flashvars is that it's not inherently built into the AC_RunActiveContent.js. I thought I could probably add it, but decided it would be easier in the long run to just add the URL detection functionality to my SWF.

I think the problem that you're running into is using both AC_RunActiveContent and SWFObject. An easy way to verify this is to delete AC_RunActiveContent.js from the server or rename it, and if your page displays correctly (the ones without the comments around the SWFObject), then you know it was because you were, in a sense, double embedding the swf.

Lots of people use SWFObject religiously. I just decided to stick to Adobe's answer to the "click to run active content" problem, even though it doesn't seem to support flashvars.



Return to posts index


Clint Milner
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 3:56:34 pm

Deleting AC_RunActiveContent and the swfobject stop all flash from being displayed.

Deleting the swfobject and having only the AC_RunActiveContent displays the content correctly

Deleting AC_RunActiveContent and using swfobject creates the same formatting error I've been running into all day.

Do you have any more information about the URL detection? It's a new concept to me, but if you think it will work in my situation, I'd like to try it.

What needs to be in the AS2 code and where and the same for the xhtml.

If you'd like to see my code, I've uploaded some zipped files at
http://www.alpha-duplication.com/Fla

index.html and the pages under the Data Services are formatted correctly, glossary and fulfilment under Technical Info have the flash var code, but aren't formatted correctly.

If you have time, it'd be great to get an outside eye.

Clint



Return to posts index

Pieter Helsen
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 4:05:03 pm

It is possible to use flashvars alongside AC_RunActiveContent. In the source is a method called AC_FL_RunContent() and inside the parentheses there's a list of pairs of values. You need to add 'flashvars', 'var1=val1&var2=val2' to that list (the place is irrelevant) for flashvars to work.

Anyhoo, I still prefer SWFObject (the 1.5 version anyway).

Clint, try creating a second div, a container div, around the sidebar1 div and apply all the styles to that container instead of the sidebar1 div. (Also, make sure to set the width of the container div to 276)

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

Clint Milner
Re: [AS2.0] adding FlashVars has changed my layout? - Please Help!
on Aug 4, 2008 at 4:42:01 pm

Pieter,

Thanks for the idea, i've just wrapped the sidebar1 in a div and everything to be in the main content of the page in a div, adjusted some aligns and floats, and it seems to be working, flashvars and all.

Thanks for the help as well Sam.

Clint



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]