SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Im watching you... Solitary R@F's Avatar
    Join Date
    Mar 2003
    Location
    Right around the corner..
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A simple Question

    Hi JavaScripters...

    I'm a user of Flash & know little about Javascript.
    I've got a simple Javascript question. How did www.kswiss.com put that shaking effect at the end of their intro?
    Pls reply ASAP. Thank YOU!
    SolitaryGrafix
    PM | EMAIL

    "Fail to Plan... Plan to Fail"--- A self-help guru

  2. #2
    SitePoint Zealot tss68nl's Avatar
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <SCRIPT LANGUAGE="JavaScript1.2">
    	function shake_xy(n) {
    	if (self.moveBy) {
    		for (i = 10; i > 0; i--) {
    			for (j = n; j > 0; j--) {
    			self.moveBy(0,i);
    			self.moveBy(i,0);
    			self.moveBy(0,-i);
    			self.moveBy(-i,0);
    			}
    		  }
    	   }
    	}
    </SCRIPT>
    Thats how. Call that function, n is the amount of time spend shaking with the current amplitude...so you can see it as a duration setting. The higher the value n, the longer the shake will excute.

  3. #3
    Im watching you... Solitary R@F's Avatar
    Join Date
    Mar 2003
    Location
    Right around the corner..
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, thanks... But it would be a great help if U could tell me how to put that in flash...
    SolitaryGrafix
    PM | EMAIL

    "Fail to Plan... Plan to Fail"--- A self-help guru

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    calling javascript functions from flash is as simple as using the java_script_: protocol and the function name

    getURL ("javascript:shake_xy(2)");

    * remove the underscores vBulletin inserts
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    Im watching you... Solitary R@F's Avatar
    Join Date
    Mar 2003
    Location
    Right around the corner..
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot! U'r all great!!!!!!
    SolitaryGrafix
    PM | EMAIL

    "Fail to Plan... Plan to Fail"--- A self-help guru

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by beetle
    calling javascript functions from flash is as simple as using the java_script_: protocol and the function name

    getURL ("java_script_:shake_xy(2)");

    * remove the underscores vBulletin inserts
    I think that he was asking as to how to use that effect in flash. Now how come this would shake something in a movie or I mis-understood?
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  7. #7
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He was asking how to call a javascript function from flash -- unless I'm mistaken.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  8. #8
    Im watching you... Solitary R@F's Avatar
    Join Date
    Mar 2003
    Location
    Right around the corner..
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    beetle's right...that's what I asked... how to call it the JS from flash.
    SolitaryGrafix
    PM | EMAIL

    "Fail to Plan... Plan to Fail"--- A self-help guru

  9. #9
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Solitary [email="R@F"
    R@F[/email]]
    beetle's right...that's what I asked... how to call it the JS from flash.
    Oh!! Sorry then, my mistake. I thought that you were asking how to put that shaking effect into your flash movie.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  10. #10
    Im watching you... Solitary R@F's Avatar
    Join Date
    Mar 2003
    Location
    Right around the corner..
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's okay... Thanks anyway!
    SolitaryGrafix
    PM | EMAIL

    "Fail to Plan... Plan to Fail"--- A self-help guru


Bookmarks

Posting Permissions

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