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

Similar Threads
thread Thread Starter Forum Replies Last Post
Dashcode on Mavericks iJC-1976 OS X Mavericks (10.9) 6 Mar 8, 2014 11:33 AM
dashcode help fracksoup Mac Programming 1 Nov 15, 2013 12:10 PM
How to get Dashcode bb13 Mac Programming 3 Aug 4, 2013 10:39 AM
Downloading Dashcode sh0vel Mac Programming 4 Apr 30, 2013 09:14 AM
Dashcode on ML? mathcolo Mac Programming 1 Aug 15, 2012 04:56 PM

Forum Jump

All times are GMT -5. The time now is 09:58 AM.

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

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