+ Reply to Thread
Results 1 to 11 of 11

Thread: Help with script
      
   

  1. #1
    MrCirrus's Avatar
    MrCirrus is offline Master Sergeant
    Join Date
    Aug 2006
    Location
    uk
    Posts
    66

    Default Help with script

    Please look on my website below select "results" and "day 1" from the menu bar. You will see i've used a script from rainbow arch which allows me to have a glider follow the cursor (orginally it was snoopy but i changed images). Problem is the image doesnt change direction like it should. In fact when i go to rainbowarch wher i got the script the same thing happens so i suspect it is a fault in the code. Can anyone out there tell me how to correct the code ? http://www.rainbow.arch.scriptmania....sor_trail.html

  2. #2
    Bethers's Avatar
    Bethers is offline Major General & Forum Moderator
    Join Date
    Feb 2006
    Posts
    5,232

    Default Re: Help with script

    It changes direction on their site for me on IE - but annoyed me so much that I wouldn't stay on a site with it - might be cute on a kids site tho where parents aren't going there.

    And remember it won't work at all on Firefox - I had to remember that and switch to IE to look at it.

  3. #3
    Stroke.nz's Avatar
    Stroke.nz is offline The Man
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    188

    Default Re: Help with script

    Quote Originally Posted by MrCirrus
    Please look on my website below select "results" and "day 1" from the menu bar. You will see i've used a script from rainbow arch which allows me to have a glider follow the cursor (orginally it was snoopy but i changed images). Problem is the image doesnt change direction like it should. In fact when i go to rainbowarch wher i got the script the same thing happens so i suspect it is a fault in the code. Can anyone out there tell me how to correct the code ? http://www.rainbow.arch.scriptmania....sor_trail.html

    Ok I download the snoopy script etc, this is how it looks on my test page, works well lol
    http://www.eko.co.nz/test.php

    For the glider do you have 3 views of it like the snoopy pics? or some where I can get them, then I can run another test page and work the bugs out ::P

    For the main script copy and paste "Between Head Tag"

  4. #4
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Help with script

    It works BOTH on their site AND on yours. At least it did for me.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  5. #5
    MrCirrus's Avatar
    MrCirrus is offline Master Sergeant
    Join Date
    Aug 2006
    Location
    uk
    Posts
    66

    Default Re: Help with script

    Ok the glider moves around. But it should face right when you move the cursor right, and face left when you move cursor left. My glider just faces down all the time and when i look at the rainbow script, snoopy only faces in one direction all the time as you move the cursor yet there are three snoopies that face in different directions. Dave i've added extra pictures for you to play with on the page (just rotated the down facing image). I know it all seems rather pathetic playing around with this but i get great pleasure in solving these problems.Or should i say getting you lot to solve them for me!!!

  6. #6
    Stroke.nz's Avatar
    Stroke.nz is offline The Man
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    188

    Thumbs up Re: Help with script

    Hey Mate

    Here you go copy script and paste "Between Head Tag" main html

    <SCRIPT type="text/javascript">
    /*


    var Ver4=parseInt(navigator.appVersion.charAt(0))>=4
    var IE=navigator.appName.indexOf("Microsoft")!=-1
    var al, imagesrc, ex=-32, ey=-32, x0=-32, y0=-32

    function Moveglider()
    {
    if (Math.abs(ex-x0)>=10) { x0+=Math.floor((ex-x0)*0.1) }
    else if (ex!=x0) { x0+=Math.abs(ex-x0)/(ex-x0) }
    if (Math.abs(ey-y0)>=10) { y0+=Math.floor((ey-y0)*0.1) }
    else if (ey!=y0) { y0+=Math.abs(ey-y0)/(ey-y0) }

    imagesrc=""
    if ( (ex<x0) && ( (x0-ex) > Math.abs(y0-ey)/2 ) )
    { imagesrc="gliderL.gif"
    if ( (x0-ex) < Math.abs(y0-ey)*2 )
    { if (ey<y0) imagesrc="gliderL.gif"
    if (ey>y0) imagesrc="gliderL.gif"
    }
    }
    if ( (ex>x0) && ( (ex-x0) > Math.abs(y0-ey)/2) )
    { imagesrc="gliderR.gif"
    if ( (ex-x0) < Math.abs(y0-ey)*2 )
    { if (ey<y0) imagesrc="gliderR.gif"
    if (ey>y0) imagesrc="gliderR.gif"
    }
    }
    if (imagesrc=="")
    { if (ey<y0) imagesrc="gliderR.gif"
    if (ey>y0) imagesrc="gliderR.gif"
    if ((ex==x0)&&(ey==y0)) imagesrc="glide.gif"
    }

    if (Ver4)
    { if (!IE)
    { document.FlyLayer.document.images.fly.src=imagesrc }
    else document.all.FlyLayer.document.images.fly.src=imag esrc
    }
    al.left=x0-47
    al.top=y0

    setTimeout("Moveglider();",100)
    }

    function MainMouseEvent(e)
    {
    if (Ver4)
    { if (!IE)
    { ex=e.pageX
    ey=e.pageY }
    else
    { ex=event.clientX + document.body.scrollLeft
    ey=event.clientY + document.body.scrollTop }
    }
    }

    function ScriptSetup()
    {
    isIm = (document.images) ? 1 : 0
    if (isIm)
    { arImLoad = new Array
    ('glider','gliderL','gliderR')
    arImList = new Array ()
    for (counter in arImLoad)
    { arImList[counter] = new Image()
    arImList[counter].src = arImLoad[counter] + '.gif'
    }
    }

    if (Ver4)
    { if (!IE)
    { al=document.FlyLayer
    document.captureEvents(Event.MOUSEMOVE)
    }
    else
    { al=document.all.FlyLayer.style }
    document.onmousemove = MainMouseEvent
    Moveglider()
    }
    }

    function Showglider()
    {
    if(Ver4)
    { s ='<DIV STYLE="visibility:hidden"></DIV>'
    s+='<DIV ID="FlyLayer" STYLE="position:absolute; '
    s+='top:-32; left:-32; width:32; height:32">'
    s+=''
    s+='<IMG NAME="fly" SRC="glider.gif" border=0>'
    s+='</A></DIV>'
    document.writeln(s)
    }
    }

    window.onload = ScriptSetup
    Showglider()

    </SCRIPT>


    Copy the next code then open notepad paste and save file as "glider.js"

    /*
    glider Follow Cursor Trail

    */

    var Ver4=parseInt(navigator.appVersion.charAt(0))>=4
    var IE=navigator.appName.indexOf("Microsoft")!=-1
    var al, imagesrc, ex=-32, ey=-32, x0=-32, y0=-32

    function Moveglider()
    {
    if (Math.abs(ex-x0)>=10) { x0+=Math.floor((ex-x0)*0.1) }
    else if (ex!=x0) { x0+=Math.abs(ex-x0)/(ex-x0) }
    if (Math.abs(ey-y0)>=10) { y0+=Math.floor((ey-y0)*0.1) }
    else if (ey!=y0) { y0+=Math.abs(ey-y0)/(ey-y0) }

    imagesrc=""
    if ( (ex<x0) && ( (x0-ex) > Math.abs(y0-ey)/2 ) )
    { imagesrc="glider.gif"
    if ( (x0-ex) < Math.abs(y0-ey)*2 )
    { if (ey<y0) imagesrc="gliderL.gif"
    if (ey>y0) imagesrc="gliderL.gif"
    }
    }
    if ( (ex>x0) && ( (ex-x0) > Math.abs(y0-ey)/2) )
    { imagesrc="snoopr.gif"
    if ( (ex-x0) < Math.abs(y0-ey)*2 )
    { if (ey<y0) imagesrc="gliderR.gif"
    if (ey>y0) imagesrc="gliderR.gif"
    }
    }
    if (imagesrc=="")
    { if (ey<y0) imagesrc="glider.gif"
    if (ey>y0) imagesrc="glider.gif"
    if ((ex==x0)&&(ey==y0)) imagesrc="glider.gif"
    }

    if (Ver4)
    { if (!IE)
    { document.AlienLayer.document.images.alien.src=imag esrc }
    else document.all.AlienLayer.document.images.alien.src= imagesrc
    }
    al.left=x0-47
    al.top=y0

    setTimeout("Moveglider();",100)
    }

    function MainMouseEvent(e)
    {
    if (Ver4)
    { if (!IE)
    { ex=e.pageX
    ey=e.pageY }
    else
    { ex=event.clientX + document.body.scrollLeft
    ey=event.clientY + document.body.scrollTop }
    }
    }

    function ScriptSetup()
    {
    isIm = (document.images) ? 1 : 0
    if (isIm)
    { arImLoad = new Array
    ('glider','gliderL','gliderR')
    arImList = new Array ()
    for (counter in arImLoad)
    { arImList[counter] = new Image()
    arImList[counter].src = arImLoad[counter] + '.gif'
    }
    }

    if (Ver4)
    { if (!IE)
    { al=document.AlienLayer
    document.captureEvents(Event.MOUSEMOVE)
    }
    else
    { al=document.all.AlienLayer.style }
    document.onmousemove = MainMouseEvent
    Moveglider()
    }
    }

    function Showglider()
    {
    if(Ver4)
    { s ='<DIV STYLE="visibility:hidden"></DIV>'
    s+='<DIV ID="AlienLayer" STYLE="position:absolute; '
    s+='top:-32; left:-32; width:32; height:32">'
    s+=''
    s+='<IMG NAME="alien" SRC="glider.gif" border=0>'
    s+='</A></DIV>'
    document.writeln(s)
    }
    }

    window.onload = ScriptSetup
    Showglider()


    And for the html code box where the glider will start place this code thier

    <SCRIPT LANGUAGE=JavaScript src="glider.js"></SCRIPT>

    For the glider files I have loaded the pics on to the test page just copy and save as.......

    http://www.eko.co.nz/test.php

  7. #7
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Help with script

    Hi Stroke,

    it doesn't work for me in your test page. The glider is always facing down.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  8. #8
    Stroke.nz's Avatar
    Stroke.nz is offline The Man
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    188

    Smile Re: Help with script

    Quote Originally Posted by navaldesign
    Hi Stroke,

    it doesn't work for me in your test page. The glider is always facing down.

    Hey Naval

    The script that was off that site only works on angles not for stright L/R turns lol

  9. #9
    MrCirrus's Avatar
    MrCirrus is offline Master Sergeant
    Join Date
    Aug 2006
    Location
    uk
    Posts
    66

    Default Re: Help with script

    Hi Dave, Thanks for your help with this. I tried http://www.eko.co.nz/test.php 5 hours ago and it worked perfectly. I,m trying it now and it just points down? I've tried modifying my page as you described, check I followed you correctly.
    1 Copied and pasted first code to "between head" portion of page
    2 Copied second part and saved it as glider.js i then COPIED THIS FILE INTO MY PUBLIC FOLDER - is that correct?
    3 I then added the extra line of script into my HTML box on the page.
    4 I also changed the naming of my existing gif images from snoopy to glider to match your code.

    Regreatably it doesnt seem to work - have i done something wrong?
    Thanks for your help, i appreciate the work youve put into solving this for me. BTW I like the use of your MS Agent on the http://www.nz-stroke.com/

  10. #10
    Stroke.nz's Avatar
    Stroke.nz is offline The Man
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    188

    Default Re: Help with script

    Quote Originally Posted by MrCirrus
    Hi Dave, Thanks for your help with this. I tried http://www.eko.co.nz/test.php 5 hours ago and it worked perfectly. I,m trying it now and it just points down? I've tried modifying my page as you described, check I followed you correctly.
    1 Copied and pasted first code to "between head" portion of page
    2 Copied second part and saved it as glider.js i then COPIED THIS FILE INTO MY PUBLIC FOLDER - is that correct?
    3 I then added the extra line of script into my HTML box on the page.
    4 I also changed the naming of my existing gif images from snoopy to glider to match your code.

    Regreatably it doesnt seem to work - have i done something wrong?
    Thanks for your help, i appreciate the work youve put into solving this for me. BTW I like the use of your MS Agent on the http://www.nz-stroke.com/

    OKs you are nearly there on my test page copy the 3 glider gif images and then load them up to server

  11. #11
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Help with script

    Now it works ok for me. However, a 4 direction script would be needed here. Seeing a glider moving backwards is, at least, unusual. Not Strokes fault of course, it's the original script that was intended to be like this.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49