RotatableScalable Sample? 
Posted: 20 June 2008 11:18 PM   [ Ignore ]
New Member
Rank
Total Posts:  12
Joined  2008-06-05

Hello there,

I was looking at the keyboard sample, but I couldn’t get it to work with the RotatableScalable.  Do you have a sample that I could see to adapt the code?

Thanks,
Jonathan

 Signature 

--------------------------
Jonathan Reyes

http://www.jonathanreyes.com

Profile
 
 
Posted: 22 June 2008 05:58 PM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  12
Joined  2008-06-05

Hey Guys and Gals,

I am still trying to figure it out.  I have it imported, but am I using the class like a movie clip because its extending it?

public var containerMC:RotatableScalable = new RotatableScalable();
this.addChild(containerMC);

Help is appreciated. Thanks.

 Signature 

--------------------------
Jonathan Reyes

http://www.jonathanreyes.com

Profile
 
 
Posted: 22 June 2008 07:10 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  596
Joined  2008-02-12

Are you referring to the keyboard object??

Taha

 Signature 

My MultiTouch Blog

Profile
 
 
Posted: 22 June 2008 07:13 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  12
Joined  2008-06-05

More or less trying to get any movie clip to have the rotate scale functionality.

Thanks,
Jon

 Signature 

--------------------------
Jonathan Reyes

http://www.jonathanreyes.com

Profile
 
 
Posted: 22 June 2008 08:16 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  596
Joined  2008-02-12

hey jon, try this bit of code

it will create a grey square that you can rotate and scale

package  
{
    
    
/**
    * ...
    * @author DefaultUser (Tools -> Custom Arguments...)
    */
    
import flash.events.*;
    
import app.core.action.RotatableScalable;
    
import flash.display.*;
    
    
    
    public class 
Main extends Sprite
    {
        
private var parentScaleCanvas:RotatableScalable;
        private var 
childMoveCanvas:MovieClip;
        
        public function 
Main() 
        
{
            
//Setups up Stage
            //Creates a Canvas that rotates and Scales
            //parentScaleCanvas never moves/rotates, but scales
            //childMoveCanvas never scales, but moves and rotates.

            
parentScaleCanvas = new RotatableScalable();
            
parentScaleCanvas.graphics.beginFill(0x101010,1.0);
            
parentScaleCanvas.graphics.drawRect(-1500,-1500,3000,3000);
            
parentScaleCanvas.graphics.endFill();
            
            
childMoveCanvas = new MovieClip();
           
            
parentScaleCanvas.0;
            
parentScaleCanvas.0;
           
            
this.addChild(parentScaleCanvas);
            
parentScaleCanvas.addChild(childMoveCanvas);
            
            
//Sets up communication with TUIO
            
TUIO.initthis'localhost'3000''true );
        
}
        
    }
    
}

If you need help with anything else let me know…

Taha

 Signature 

My MultiTouch Blog

Profile
 
 
Posted: 23 June 2008 01:59 AM   [ Ignore ]   [ # 5 ]
New Member
Rank
Total Posts:  12
Joined  2008-06-05

Awesome, thank you so much. I will take a look at the code in a bit.

 Signature 

--------------------------
Jonathan Reyes

http://www.jonathanreyes.com

Profile
 
 
Posted: 27 June 2008 10:31 AM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  11
Joined  2008-06-19

hi Taha or anybody that can help me

i tried the code for the grey square but it didn´t work, i don´t want to bother you very much, but can you post it complete with all the variable declarations and all the import statements please? i would really appreciate it.

i´m new at this so i don´t understand so much.

thank you very much

Profile
 
 
Posted: 27 June 2008 10:54 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  596
Joined  2008-02-12

hey revai,
All the code is there, have you added the classes to the project

Taha

 Signature 

My MultiTouch Blog

Profile
 
 
Posted: 27 June 2008 11:39 AM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  11
Joined  2008-06-19

i added

import com.touchlib.*;

and declared the variables

private var parentScaleCanvas:RotatableScalable;
private var childMoveCanvas:MovieClip;

and it worked but now i can´t put images in the stage and make them work, i don´t know why…

here is my code so maybe you can help me

package  
{
    
    
/**
    * ...
    * @author DefaultUser (Tools -> Custom Arguments...)
    */
    
import flash.events.*;
    
import app.core.action.RotatableScalable;
    
import flash.display.*;
    
import com.touchlib.*;
    
    
    
    public class 
rotar_escalar extends Sprite
    {
        
private var parentScaleCanvas:RotatableScalable;
        private var 
childMoveCanvas:MovieClip;
        private var 
childMoveCanvas1:MovieClip;
        
        public function 
rotar_escalar() 
        
{
            
//Setups up Stage
            //Creates a Canvas that rotates and Scales
            //parentScaleCanvas never moves/rotates, but scales
            //childMoveCanvas never scales, but moves and rotates.
            //childMoveCanvas is like the old subobj
            
parentScaleCanvas = new RotatableScalable();
            
parentScaleCanvas.graphics.beginFill(0x101010,1.0);
            
parentScaleCanvas.graphics.drawRect(0,0,300,300);
            
parentScaleCanvas.graphics.endFill();
            
childMoveCanvas = new MovieClip();
            
parentScaleCanvas.0;
            
parentScaleCanvas.0;
            
this.addChild(parentScaleCanvas);
            
parentScaleCanvas.addChild(childMoveCanvas);
            
            
parentScaleCanvas = new RotatableScalable();
            
parentScaleCanvas.graphics.beginFill(0xffffff3300,1.0);
            
parentScaleCanvas.graphics.drawRect(50,50,300,300);
            
parentScaleCanvas.graphics.endFill();
            
childMoveCanvas1 = new MovieClip();
            
parentScaleCanvas.0;
            
parentScaleCanvas.0;
            
this.addChild(parentScaleCanvas);
            
parentScaleCanvas.addChild(childMoveCanvas1);
            
            
            
parentScaleCanvas = new RotatableScalable();
            var 
s4 = new Sum();
            
s4.Math.random()*200+100;
            
s4.Math.random()*200+100;
            
s4.scaleX Math.random();
            
s4.scaleY s4.scaleX;
            
s4.rotation Math.random()*100;
            
parentScaleCanvas.addChild(s4);
            
            
parentScaleCanvas = new RotatableScalable();
            var 
ho = new home1();
            
ho.Math.random()*200+100;
            
ho.Math.random()*200+100;
            
ho.scaleX Math.random();
            
ho.scaleY ho.scaleX;
            
ho.rotation Math.random()*100;
            
parentScaleCanvas.addChild(ho);
            
            
//Sets up communication with TUIO
            
TUIO.initthis'localhost'3000''true );
        
}
        
    }
    
}

Profile
 
 
Posted: 27 June 2008 12:05 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  596
Joined  2008-02-12

ohh you have a older version of the svn..... i suggest updating the it from the svn
ummm for the images, do you have a class that handles images. and what does your the home1 function and sum function do?

Taha

 Signature 

My MultiTouch Blog

Profile
 
 
Posted: 27 June 2008 02:13 PM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  11
Joined  2008-06-19

the sum and home1 are not functions, are images, movieclips

i don´t have a class that handles images and where do i download the svn update?

Profile
 
 
Posted: 27 June 2008 02:29 PM   [ Ignore ]   [ # 11 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  265
Joined  2007-09-22

http://code.google.com/p/touchlib/source/checkout <-- here , and also have a look at the photo app

Profile
 
 
Posted: 27 June 2008 03:21 PM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  596
Joined  2008-02-12
revai - 27 June 2008 02:13 PM

the sum and home1 are not functions, are images, movieclips

i don´t have a class that handles images and where do i download the svn update?

You need to have a class or function that handles images...Vlado is right you should check out the photo app it’ll help you out.

Taha

 Signature 

My MultiTouch Blog

Profile
 
 
Posted: 27 June 2008 03:44 PM   [ Ignore ]   [ # 13 ]
New Member
Rank
Total Posts:  11
Joined  2008-06-19

thanks a lot!

Profile