• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

getting flash dynamic publishing to work

After unsuccessfully trying to get a jquery slider working, I have backed down to a simple flash demo. Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>SWFObject 2 dynamic publishing example page</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<script type="text/javascript" src="~/scripts/swfobject.js"></script>

         <script type="text/javascript">
             var playerVersion = swfobject.getFlashPlayerVersion();
             output = "You have Flash player " + playerVersion.major + "." + playerVersion.minor + "." + playerVersion.release + " installed"; alert(output); 
          </script>

		<script type="text/javascript">
		    swfobject.embedSWF("~/Flash/test.swf", "myContent", "300", "120", "9.0.0", "~/scripts/expressInstall.swf");
		</script>
	</head>
	<body>
		<div id="myContent">
			<h1>Alternative content</h1>
			<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
		</div>
	</body>
</html>

Open in new window


The alternative content shows every time.  Can't figure out what I'm missing, what files might be misplaced.
0
Mark Klein
Asked:
Mark Klein
  • 8
  • 7
1 Solution
 
saimazzCommented:
in your files addreses e.g.
swfobject.embedSWF("[b]~/Flash/test.swf[/b]", "myContent", "300", "120", "9.0.0", "[b]~/scripts/expressInstall.swf[/b]");

Open in new window

you should try to with full addresses (with http://.....)
0
 
Mark KleinAuthor Commented:
But when I deploy, all my addresses are relative.  Been using that relative address format all through a large asp.net.  And the relevant full address when deployed is different than the address on my dev machine
0
 
saimazzCommented:
in that case you could use some constant from config. e.g in codeigniter it would look like this:

swfobject.embedSWF("<?= base_url()?>/Flash/test.swf", "myContent", "300", "120", "9.0.0", "<?= base_url()?>/scripts/expressInstall.swf");

Open in new window

0
Independent Software Vendors: 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!

 
Mark KleinAuthor Commented:
don't know codeigniter.  How does the address change affect all this?  why doesn't ~/ work?  I think I agree with your assumption (or what I suspect is your assumption), that the code is not finding the relevant modules.  I'll experiment a bit on my local machine with explicit addresses.
0
 
saimazzCommented:
that is only the example it doesnt mean that you need to use it. In the fineal result it generates full adresses, so in my case base_url() = 'http://someurl.com', i think you could use some constant, variable or function that tricks the same in asp.net. The problem i think is as you getted with relevant modules.
0
 
Mark KleinAuthor Commented:
do you think the fact that this is an htm page in an asp.net application has any effect?
0
 
saimazzCommented:
so you use this page like html, not generating from view?
0
 
Mark KleinAuthor Commented:
I use Visual Web Developer, and generated an htm page, not aspx.  When I get this working, I'll use the flash on an aspx page.  So yes, I'm just linking to an html page.
0
 
Mark KleinAuthor Commented:
I do believe it is the addressing. I dumped the swfobject.js file in the local root, as well as the swf, and got a simple flash app to run. It is very ugly having all those files in the main directory.  
Now I am trying to get my js slider to work, which relies on this xml code:

<Piecemaker>
  <Contents>
    <Image Source="~/Images/SliderImages/GetStarted.png" Title="The Piecemaker 2"></Image>
    <Image Source="~/Images/SliderImages/HowTransparencyWorks.png" Title="Lots of new Features">
      <Text>&lt;h1&gt;New hot Features&lt;/h1&gt;&lt;p&gt;The all new Piecemaker comes with lots of new features, making it even more slick.&lt;/p&gt;&lt;p&gt;Just to mention a few - you can now specify unlimited transition styles, include your own SWF and Video files, add hyperlinks to images and info texts with all special characters.&lt;/p&gt;&lt;p&gt;We also impoved the navigation and the animation with animated shadows and pixel-perfect transitions.&lt;/p&gt;</Text>
      <Hyperlink URL="http://www.modularweb.net" Target="_blank" />
   </Image>
    <Flash Source="~/Images/SliderImages/flash.swf" Title="Loaded SWF File">
      <Image Source="~/Images/SliderImages/flash-preview.png" />
    </Flash>
    <Image Source="~/Images/SliderImages/TransparencyStatement.png" Title="Editing made Easy"></Image>
    <Image Source="~/Images/SliderImages/WhyTransImportant.png" Title="Why transparency is important"></Image>
   </Contents>
  <Settings ImageWidth="900" ImageHeight="360" LoaderColor="0x333333" InnerSideColor="0x222222" SideShadowAlpha="0.8" DropShadowAlpha="0.7" DropShadowDistance="25" DropShadowScale="0.95" DropShadowBlurX="40" DropShadowBlurY="4" MenuDistanceX="20" MenuDistanceY="50" MenuColor1="0x999999" MenuColor2="0x333333" MenuColor3="0xFFFFFF" ControlSize="100" ControlDistance="20" ControlColor1="0x222222" ControlColor2="0xFFFFFF" ControlAlpha="0.8" ControlAlphaOver="0.95" ControlsX="450" ControlsY="280&#xD;&#xA;" ControlsAlign="center" TooltipHeight="30" TooltipColor="0x222222" TooltipTextY="5" TooltipTextStyle="P-Italic" TooltipTextColor="0xFFFFFF" TooltipMarginLeft="5" TooltipMarginRight="7" TooltipTextSharpness="50" TooltipTextThickness="-100" InfoWidth="400" InfoBackground="0xFFFFFF" InfoBackgroundAlpha="0.95" InfoMargin="15" InfoSharpness="0" InfoThickness="0" Autoplay="10" FieldOfView="45"></Settings>
  <Transitions>
    <Transition Pieces="9" Time="1.2" Transition="easeInOutBack" Delay="0.1" DepthOffset="300" CubeDistance="30"></Transition>
    <Transition Pieces="15" Time="3" Transition="easeInOutElastic" Delay="0.03" DepthOffset="200" CubeDistance="10"></Transition>
    <Transition Pieces="5" Time="1.3" Transition="easeInOutCubic" Delay="0.1" DepthOffset="500" CubeDistance="50"></Transition>
    <Transition Pieces="9" Time="1.25" Transition="easeInOutBack" Delay="0.1" DepthOffset="900" CubeDistance="5"></Transition>
    <Transition Pieces="9" Time="1.25" Transition="easeInOutBack" Delay="0.1" DepthOffset="900" CubeDistance="5"></Transition>
  </Transitions>
</Piecemaker>

Open in new window


As you can see, once again there is a lot of relative addressing.  I'm trying to find a way around it.  Suggestions?
0
 
saimazzCommented:
hmm, you could try change address type from thii

~/Images/SliderImages/GetStarted.png

Open in new window


to this:

Images/SliderImages/GetStarted.png

Open in new window


remove "~/" from begining
0
 
Mark KleinAuthor Commented:
that's exactly what I did.  Also changed around the directory structure.  have my slider working as an htm (just open the file in a browser), but not yet from within my asp.net application
0
 
saimazzCommented:
what is your url where your application is? maybe you need add to some "../" to direct where youre resources are
0
 
Mark KleinAuthor Commented:
I'm still working in my dev environment on my local machine.  For that I think I need the ~/ structure so localhost can find the resources.  

Ultimately, I've got to get this html onto/into an aspx page, and so far no luck.  I can put the javascript in the head block, but I want the embed in another content placeholder.  I'm really groping in the dark.
0
 
saimazzCommented:
can you give url where is your developing project to take a bit look?
0
 
Mark KleinAuthor Commented:
will do later this morning, as much as possible
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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