How to port 2D performer GamePlay to iphone?

I tried to port 2D performer GamePlay tutorial to iphone

When I open it in unity iphone, it has a lot of errors:

Assets/Scripts/2D/LevelAttributes.js(44,21): BCE0019: ‘size’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/LevelAttributes.js(45,21): BCE0019: ‘center’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(31,41): BCE0019: ‘interpolation’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(103,55): BCE0019: ‘heightOffset’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(104,59): BCE0019: ‘distanceModifier’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(105,60): BCE0019: ‘velocityLookAhead’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(105,60): BCE0019: ‘velocityLookAhead’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(106,55): BCE0019: ‘maxLookAhead’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(122,50): BCE0019: ‘velocity’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Character Controls/PlatformerController.js(242,33): BCE0019: ‘emit’ is not a member of ‘UnityEngine.Component’.

Assets/Scripts/2D/Camera/CameraScrolling.js(127,61): BCE0019: ‘GetVelocity’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(6,14): BCE0019: ‘SetWidth’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(7,14): BCE0019: ‘SetVertexCount’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(9,14): BCE0019: ‘material’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(10,14): BCE0019: ‘SetColors’ is not a member of ‘UnityEngine.Component’.

Is there any iphone version?

How should I fix them?

you must explicitely define what the output of Getcomponent is otherwise its a component and you will get the errors you see there with “component does not have bla”.

there are about 3 dozen threads on the matter of dynamic typing which is not present in js on the iphone.

from what I recall some unity iphone user ported the 2d j’n’r tutorial code to the iphone though and released it on the board

I search the keyword : 2d tutorial iphone
under iphone development

There is only one thread
http://forum.unity3d.com/viewtopic.php?t=15122&postdays=0&postorder=asc&start=15

And, I imported the code but still got the last 4 errors:

Assets/lineColor.js(6,14): BCE0019: ‘SetWidth’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(7,14): BCE0019: ‘SetVertexCount’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(9,14): BCE0019: ‘material’ is not a member of ‘UnityEngine.Component’.

Assets/lineColor.js(10,14): BCE0019: ‘SetColors’ is not a member of ‘UnityEngine.Component’.

Here is the code in lineColor.js

var lineMaterial : Material;

function Start()
{ 
	line = this.gameObject.AddComponent(LineRenderer); 
	line.SetWidth(.5, .5); 
	line.SetVertexCount(2); 
	// line.useWorldSpace = true; 
	line.material = lineMaterial; 
	line.SetColors(Color(1,0,0,1), Color(1,0,0,1)); 
	//line.renderer.enabled = false; 
	//the line is later enabled 
}

How should I fix them?

Simply put, for efficiency purposes unity-iphone uses strongly typed javascript. In the case of your code it would appear your structs are not defined to a high enough level. It appears that you are trying to access other component variables, but are getting the class rather then the instace.
The unity engine has interpreted your code as such because of this.

Camera.velocitLookAhead=x;

==

Component.yourVariable= x;

Get the instance of the variable you need in start;

var theCamera : Camera;
Start()
{
var theCamera = GameObject.FindWithTag ("MainCamera");
}