Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 387613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:41:24+00:00 2026-05-12T15:41:24+00:00

I load an image and add it to the MC someMC. If something is

  • 0

I load an image and add it to the MC someMC. If “something” is true, the someVariable gets the someMC scaleX number. Let’s say its 0.82.

What I need is to get that number into the s.value in my Slider object. Since I want the Slider value to be where my image scale is.

This of course doesn’t work because of variable scope limitations.

I have tried setting the variable at the top of the code like this:
var someVariable:Number;
but that didn’t work either.

Here’s the code:

function completeHandler(event:Event):void{
     if (something) {
          var someVariable:Number = this.someMC.scaleX;
     }
}   


var s:Slider = new Slider();
s.maximum = 500;
s.minimum = 10;
s.value = someVariable;

Any thoughts?

Update
I’m looking for a solution without having to use package and class, since I’m not that steady with AS3 yet.

Update 2
I’ve uploaded all the code to Pastebin. Take a look 😉

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:41:24+00:00Added an answer on May 12, 2026 at 3:41 pm

    The this in your completeHandler is not the document. Try just someMC.scaleX, and assuming you declared it on your main timeline or wherever, it should have access to it. The scaleX property also only ranges from 0 to 1, so if your Slider is from 10:500 — that’s not going to work. I put * 100 in there for you, but do whatever math is required to fix the scale to what you were intending.

    Also, you need to explicitly set the Slider’s value in the handler, rather then just changing the var. Variables aren’t passed like that in AS3.

    function completeHandler(event:Event):void{
             if (something) {
                      var someVariable:Number = someMC.scaleX;
                      s.value = someVariable * 100;
             }
    }   
    
    
    var s:Slider = new Slider();
    s.maximum = 500;
    s.minimum = 10;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to load an image from a web in a simple Java stand
i Had load my image Buffered image now need to brighten it using Slider
i am trying to load a .TIF formatted image to add into Jlist and
I have an ASHX handler returning an image on page load. I need to
I Want to load Image size 2550X3300 (i.e 1.7 Mb size), i have loaded
I found difficulty to load image from url in every 30 seconds in android
I'd like to load image(s) at runtime (dynamically) into my report (inside the header).
How to load an image file (on SD card) into a Bitmap on Android?
I want to load an image, resize it to a given size and after
I want to load the image URL from my NSMutableArray. Here is my Code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.