Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 4, 2008, 04:14 PM   #1
Avizzv92
macrumors regular
 
Join Date: Mar 2008
Dashcode Animation Code

I'm trying to have an object (ovalShape) to move to a right position when clicked on. I'm using the code snippet from the dashcode library. But I can't seem to get it too work.

Here's the code, tell me if I'm doing something wrong.

Quote:
// Values you provide
var itemToMove = document.getElementById("ovalShape"); // replace with ID of element to move
var moveToRightPosition = 100; // new right CSS value

// Moving code
var originalRight = parseInt(document.defaultView.getComputedStyle(ite mToMove, null).getPropertyValue("right"));
var moveHandler = function(a, c, s, f){ itemToMove.style.right = c + "px"; };
new AppleAnimator(500, 13, originalRight, moveToRightPosition, fadeHandler).start();
When I do click on the object I get an error "can't find variable fadeHandler"
Avizzv92 is offline   0 Reply With Quote
Old Feb 25, 2010, 02:10 AM   #2
rmazz
macrumors newbie
 
Join Date: Feb 2010
Location: San Francisco, CA
Correction to Dashcode Animation Code

I got caught by this one too. It is actually Apple's mistake in the last line:
new AppleAnimator(500, 13, originalRight, moveToRightPosition, fadeHandler).start();
should read:
new AppleAnimator(500, 13, originalRight, moveToRightPosition, moveHandler).start();

The moveHandler is what is defined in the line above it. Change it and it will work.
rmazz is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Help writing a WebApp with Dashcode iJC-1976 Mac Programming 3 May 11, 2011 12:48 AM
show list in Dashcode - Execution exceeded timeout jarv Web Design and Development 0 Feb 9, 2011 06:29 AM
dashcode errors in custom JavaScript jarv Web Design and Development 2 Jan 23, 2011 05:31 AM


All times are GMT -5. The time now is 05:29 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC