Controlling Item Position on Stage with the Slider Component

Wed, Jan 27, 2010

ActionScript

Controlling Item Position on Stage with the Slider Component

This movie requires Flash Player 9

Learn how to control and track item position on stage using the slider component.

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 The Slider Component
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

import fl.controls.Slider;
import fl.events.SliderEvent;
// This will import slider
// properties, methods and events

xSlider.value = ball.x;
ySlider.value = ball.y;
//This will adjust the sliders
// to hold the value of the
// coordinates of present location

xSlider.addEventListener (SliderEvent.CHANGE, sliderChange);
ySlider.addEventListener (SliderEvent.CHANGE, sliderChange);
//Both Sliders will go to the same function

function sliderChange (event:SliderEvent){
switch (event.target.name){
case ‘ySlider’:
ball.y = event.target.value;
break;

case ‘xSlider’:
ball.x = event.target.value;
break;}

x_txt.text = String(ball.x);
y_txt.text = String(ball.y);
}

//thanks for watching
// subscribe from the website.

Related Articles:

, , , , , , , , , , , , , , ,

6 Responses to “Controlling Item Position on Stage with the Slider Component”


Trackbacks/Pingbacks

  1. Click Here says:

    here’s an article i ran across from…

    businessgrow.com with 25 of them! http://bit.ly/ald2ie. let me know what you think. are you already blogging? let me know how i can help. last weekend, i spoke at a seminar on the topic of social media and we spent some time…

  2. Site says:

    who know how to right good, and…

    not just good but on any topic. they have a sway with the language, at least the successful ones and if you are thinking about making a blog and then start earning money with it then you are on the right…

  3. hcg diet says:

    Great information…

    This is awesome. So we checked out this amazing gratify therefore we are startled. We are most certainly interested in this type of merchandise. Model appreciate users put, and worth your time inside this. Please keep add relevant content. These are so…

  4. Great information…

    This can be exceptional. Nutritionists watch this footed therefore we are astounded. We are precisely curious about this kind of the whole internet marketing thing. Only appreciate body information and facts, and profit the effort in this. Please keep …

  5. Visitor recommendations…

    [...]one of our visitors recently recommended the following website[...]……

  6. Great information…

    This can be distinctive. An individual looked at this key fact please so we are startled. We’re interested in one of these factors. That is why we appreciate ones endeavor, and value for money your time in this. Please keep modifying. They’re hugely …

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


832
Unique Visitors
Previous 30 Days
Powered By Google Analytics