Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Embedding Problem SWFObject

    I'm getting Error: Object doesn't support property or method 'addEvent' in my webpage.

    I'm trying to embed a flash carousel in an asp.net page and I have this, but nothing is showing on my page. Using IE9 and FF4

    Code:
     <script type="text/javascript">
            window.addEvent('load', function() { 
                var flashvars = {
                    xmlLocation: "<%=ResolveUrl("upload/data.xml")%>",
                    imageLocation: "<%=ResolveUrl("~/upload/")%>"
                };
                swfobject.embedSWF("<%=ResolveUrl("~/upload/Carousel-Test.swf")%>", "FlashContainer", "576", "242", "10.0.32", "", flashvars, null, null);
           });
            </script>
    The xml has some settings for the images and all my images are in the upload folder in my project. I have reference to the swfobject js in the masterpage (head) and the homepage inherits from it:
    Code:
    <script src="javascript/swfobject.js" type="text/javascript"></script>.
    Anyone give some suggestions?
    Last edited by CG2011; 04-08-2011 at 03:15 PM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Why are you trying to add an event? Just remove the add event stuff. No need for our unless you really need to have it load after everything else loads.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks for getting back.

    i thought that error was the reason why my flash was not displaying. while it;s got rid of the error my flash is still not shown on page.

    any suggestions?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Do you have a div with id="FlashContainer" in your html? The argument after the flash version should be false. That is for the express install option. What version of flash player do you have?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    hey,

    i do have div with id=FlashContainer. i;ve now set the value to false and i checked the flash version which was incorrect, so now i've corrected that. still, it won't show up. i've made some changes in case it was not finding directory properly. flash file is now at root level while my images/xml file which is still in upload folder.

    Code:
            <script src="javascript/swfobject.js" type="text/javascript"></script>
                        <script type="text/javascript">
                         function () {
                            var flashvars = {
                                xmlLocation: ("upload/data.xml"),
                                imageLocation: ("upload")
                            };
                            swfobject.embedSWF("Carousel-Test.swf", "FlashContainer", "576", "242", "10.2.153.1", false, flashvars, null, null);
                        };
            </script>
    anything else i can try? thanks for the help

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You didn't remove everything you were supposed to.
    Try this
    Code:
    <script src="javascript/swfobject.js" type="text/javascript"></script>
                        <script type="text/javascript">
                            var flashvars = {
                                xmlLocation: "upload/data.xml",
                                imageLocation: "upload"
                            };
                            swfobject.embedSWF("Carousel-Test.swf", "FlashContainer", "576", "242", "9.0.0.0", false, flashvars, null, null);
            </script>
    Compare that to what you have. Note that I changed the flash version number. Not everyone will have the latest version due to them not knowing to upgrade or they can't for some reason. I removed the empty "function" you had.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    CG2011 (04-09-2011)

  • #7
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    many thanks for your help! i used what you wrote and that seemed to work. i have one final thing though. while the flash object is now appearing inisde my div, it supposed to display my images on the flash - which are basically links to other pages. the settigns is on data.xml which is in the upload folder and code is like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <settings
    
    rotationKind="1"
    rotationSpeed="4"
    enableMouseWheel="0"
    stopRotatingOnMouseOver="1"
    
    autoRotateMode="0"
    autoRotateInterval="0"
    stopAutoRotateOnClick="1"
    
    useTooltip="0"
    tooltipColor1="#5C9BF8"
    tooltipColor2="#ffffff"
    tooltipColor3="#999999"
    showTooltipHelp="0"
    tooltipHelpMove="Click to rotate to front"
    tooltipHelpLink="Click to follow this link"
    
    useSubtitle="1"
    subtitleY = "265"
    useSecondCaption="1"
    
    useNavigationButtons="0"
    navigationY = "420"
    
    borderColor="#ffce00"
    borderThickness="3.5"
    useImageSmoothing="1"
    playRollOverSound="0"
    
    spanX="175"
    spanY="30"
    centerX="325"
    centerY="225"
    distanceValue="0"
    distanceDarken="0.5"
    perspectiveRatio="0.8"
    minimumscale="0.5"
    
    useFocalBlur="1"
    focalBlurValue="0.15"
    useMotionBlur="1"
    motionBlurValue="0.5"
    useFadeOnMouseOver="0"
    mouseOverDarkness=".2"
    useReflection="1"
    reflectionAlphaValue="0.5"
    
    />
    
    <thumbs>
    
      <thumb
    		type="image"
    		imageURL="~img1.jpg"
    		linkData="http://www.t1.html"
    		linkType="URL"
    		linkTarget="_blank"
    		captionText="test img 1"
    		captionText2="test img 1"
    		enableButtonWhenInFront="1"
    	/>
    
      <thumb
    		type="image"
    		imageURL="img2.jpg"
    		linkData="http://www.t1.html"
    		linkType="URL"
    		linkTarget="_blank"
    		captionText="test img2"
    		captionText2="test img2"
    		enableButtonWhenInFront="1"
    	/>
    </thumbs>
    any suggestion why it might not find my images?

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The only thing I can think of is the path to the images are wrong. Am I correct to assume that the images are at upload/blahsomeimage.jpg? Try this for your flashvars
    Code:
    var flashvars = {
                                xmlLocation: "/upload/data.xml",
                                imageLocation: "/upload/"
                            };
    If the page that has your flash is at the root of your site then the above should work.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    CG2011 (04-09-2011)

  • #9
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    bang on!

    i missed the slash / after upload!

    thanks for all the help!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •