• jonriley72

    (@jonriley72)


    Hi There

    Need some help if possible.

    I want a flash banner that reads an xml file as the header for my website.

    I have inserted the code as follows into header.php:

    <div id="topBar" class="container_12" >
    <script type="text/javascript" src="<?php echo get_option('home'); ?>/swfobject.js"></script>
    <script type="text/javascript">
    var so = new SWFObject("<?php echo get_option('home'); ?>/banner.swf", "mymovie", "960", "300", "9");
    so.addParam("menu", "false");
    so.addVariable("dataPath", "<?php echo get_option('home'); ?>/data.xml");
    so.write("topBar");
    </script>
    
    <h1 id="logo"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    <p><?php bloginfo('description'); ?></p>
    
    </div><!--end topBar tag -->

    Currently the files banner.swf, data.xml are in the root folder of the site, I have tried all sorts of different locations for them and it has made no difference.

    The paths to the images I want to load in the xml file are all absolute, seems to make no difference.

    I know the banner.swf file is there because I can see the controller and the loader graphic, it appears to load the xml file but still nothing.

    The paths that are generated by the header.php page all seem to be working fine, in other words if I view the source for my wordpress site cut and paste the paths to the banner.sf and data.xml file then I can see the contents, the same for the paths to the images in the xml file …

    Anyone got any ideas? Pulling my hair out and I haven’t got much to start with!

    Thanks

Viewing 1 replies (of 1 total)
  • This works to get the path to a video file. It might work for the XML.

    function getCustomField()
    {
    	global $post;
    
    	$video = js_escape(get_post_meta($post->ID, 'video', true));
    	$vid_place = js_escape(wp_get_attachment_url($video));
    
    		if($video) : ?>
    
    <script type='text/javascript' src='https://actual/path/to/swfobject.js'></script>
    <p><div id='<?php echo $video;?>'>This text will be replaced</div></p>
    <script type='text/javascript'>
      var so = new SWFObject('https://actual/path/to/player.swf','ply','470','320','9','#ffffff');
      so.addParam('allowfullscreen','true');
      so.addParam('allowscriptaccess','always');
      so.addParam('wmode','transparent');
      so.addVariable('file','<?php echo $vid_place;?>');
      so.write('<?php echo $video;?>');
    </script>
    <?php
    
    endif;
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘XML Flash banner problems’ is closed to new replies.