ActionScript 2.0 :: Flash Maths And Pixels?

Feb 27, 2009

I have a square grid with 100 grid squares in it.I want the cursor to display its grid position.Does Flash plot the position based on pixels - ie would my grid square have to be 100x100px or a multiple of that eg 200x200px? Or could it calculate the position no matter what size the square was? eg 186x186px ?

View 1 Replies


Similar Posts:


Flash 10 :: Auto Format - Maths Functions Not Done In Correct Order

Apr 23, 2011

I have some code that looks like this:
ActionScript Code:
level_btn.x = 50 + (i - 1) % 10 * 50;
It sets the x location of my level button. But this is in a for loop (that's what the 'i' is for.) I run it and everything works perfectly, as it should, not a single problem. Then I press the auto format button in the flash actionscript editor. (It's the button that adds all of the ; to the end of each line and other stuff)

Well that changes my code to this:
ActionScript Code:
level_btn.x = 50 + i - 1 % 10 * 50;
thinking it's done me a favour but it hasn't. It's got rid of the brackets so it won't do the maths functions in the correct order. I've tried adding more brackets in places and other stuff but I just don't know how to fix it. It's annoying because every time I press the auto format button I have to add the brackets in again.

View 1 Replies

ActionScript 3.0 :: Transition Manager PixelDissolve - Instead Of The Pixels Being Dissolved The Pixels Being Added?

Mar 24, 2012

so instead of the pixels being dissolved, the pixels being added? :

ActionScript Code:
var Anim:TransitionManager = new TransitionManager(blackbox);
Anim.startTransition({type:PixelDissolve, direction:Transition.OUT, duration:1, easing:None.easeOut, xSections:35, ySections:35});

basically what i would like is the end point to be the start point and the start point the end point.

View 2 Replies

ActionScript 2.0 :: Slider Bars And Scaling - Code Keeps Shrinking Initial Object Down To 10 Pixels By 10 Pixels?

Jun 17, 2009

I have a swf file that loads into my main movie, and within that swf there is a masked image that i would like to scale using zoom in and out buttons and also by using a slider bar.However i cant find any tutorials that will allow me to combine the two.I have used the following code for the buttons. Which seems to work ok but i would like it to be a little smoother. (using speed or some sort of easing??)

ActionScript Code:
zoomPlus.onRelease = function(zoomIn) {
if (test_shirt.shirt._xscale == 400 && test_shirt.shirt._yscale == 400) {[code]....

but for this code it keeps shrinking my initial object down to 10 pixels by 10 pixels..

View 0 Replies

Actionscript 2.0 :: _y Movement By Pixels - Move The Movie Clip In Incremental Moves Consisting Of 30 Pixels?

Nov 18, 2009

I have a movie clip called column1_mc. when I click a button I need to move the movie clip in incremental moves consisting of 30 pixels.

column1_mc._y = 30;

Does not work because that is giving a _y coordinate.For example.I need to make the movie clip jump to _y 300 but make 10x30 pixel incremental jumps. Moving 10 times 30 pixel jumps.

View 1 Replies

ActionScript 3.0 :: Maths: Exponential Value Via Loop?

Dec 27, 2010

To create a sort of thick-pixel gradient shadow, I've got a simple loop which creates a new 200x5 pixel Shape (rectangle) with each iteration, assigning an alpha value and y value that changes relative to the loop's iteration.

Code:
var upperShadow:Shape = new Shape();
for (var k:int=0; k<10; k++) {
shadowAlpha = (1-(k/10))*.5;
trace(shadowAlpha); // traces .5, .45, .4, .35, .3, .25, .2, .15, .1, .05

[code]....

This creates a simple linear gradient since the alpha value changes linearly, but how would I go about creating some sort of exponential/logarithmic/cubic/circular value for the alpha, so that it falls off differently?

Are there a set of common equations that people use for this sort of thing, similar to the simple (1-(k/10))*.5 I use for the linear change from .5 to 0 in ten .5 increments?

View 3 Replies

ActionScript 3.0 :: Calling Phd Maths Gods Best Random Formula?

Apr 13, 2010

I have an app that was actually written for me. It's a multiple choice quiz basically where a question comes up and there are 4 answers. HOWEVER the answer always seems to be 80% on the same answer ie: BUTTON ONE out of the four. BILLIANT random function I don't think.Would this be a better answer formula to use?
 
function randomBetween(a:Number, b:Number):Number {   return (a + Math.floor(Math.random()*(b-a+1)));}

View 8 Replies

ActionScript 3.0 :: Triangle Maths - Collecting Stars That Appear At Random Moments?

Jan 13, 2012

i want to finish it in the end! i have this code which generated 20 stars and an ai player collects all of them (going for the one which is closest to it). This code was courtesy of -lauri... the code was

ActionScript Code:
import flash.events.Event;
import flash.display.MovieClip;[code].........

what i have currently is a player who moves around with the arrow keys collecting stars which appear at random moments... i wanted to make it so that the ai can also collect these stars and i am pretty sure that the code for that would be linked to what.

View 6 Replies

ActionScript 2.0 :: Stop On Frame Label Depending On Random Maths Answer?

Mar 9, 2012

im working on a maths style jigsaw, and ive come across a problem of sorts, ive set random1_txt.text to 1 and random1_txt.text to 2 for testing, basically i want to randomise two textfields between 1 and 10, and also randomise the sign between either a - or a +

the answer can be computed by flash, now what i need it to do is stop on the frame number of the answer in answer_mc, these frames contain graphics of all numbers 1-20 in alpha format, this is so that the answer is in place, now the user can drag and drop movieclips into the answer box, and receive a correct or incorrect response

im at a loss on how to do this, i havent gotten around to randomising the sign as of yet i need to do more research but the general idea is as above

Code:
var startX:Number; //start of draggable piece
var startY:Number;
random1_txt.text = "1"

[Code].....

View 3 Replies

ActionScript 3.0 :: Triangle Maths - What Equation Would Take The AI Player On The Most Direct Route To The Star?

Jan 4, 2012

In the scene there is a star and an AI player.what equation would take the AI player on the most direct route to the star...i.e guide it into the path of the star...just to make things clear, the star is static and the ai plaer is controlled by the computer. i think you have to make two variables distx and disty and use some sort of trigonometry on them but i'm not entirely sure on how to go along doing this.

View 9 Replies

ActionScript 2.0 :: Simple Maths - Adding And Subtracting An Amout To/from A Balance Amount?

Jun 23, 2008

I have an application performing a simple calculation of adding and subtracting a amout to/from a balance amount.The problem is that every thing works fine except that when i remove the lkast amout from the balance ie: 15.25 -15.25 suppose i get something like -5.32907051820075e-15

View 2 Replies

ActionScript 2.0 :: MX04 - Create A Script Where The User Inputs A Maths Equation (something Simple Like 5 + 2 * 10)?

Aug 1, 2010

I am trying to create a script, where the user inputs a maths equation (something simple like 5 + 2 * 10), I have managed to break down the text into an array and have the numbers in one array and the symbols in another, I wanted the computer to then work it out, however I cant seem to think of how to do this and the methods that I have tried have failed.there is one dynamic box and the value of that is then broken down by an array split(" "), however this leaves the values in an array and it is percieved as a string not a number and so when i try to work it outit just displays 5 * 10, how would i get it to work that out?

View 1 Replies

ActionScript 3.0 :: Maths - When Click On The Knob It Turns 90 Either Left Or Right Depending - Get The Angle In Whole Numbers?

Mar 11, 2011

Code:
knob_mc.addEventListener(MouseEvent.MOUSE_DOWN,turn);
stage.addEventListener(MouseEvent.MOUSE_UP,endTurn );
function turn(e:Event):void[code].....

This is the code I'm using to move a knob the challenge is when i click on the knob it turns 90 either left or right depending where i click, I'd like it to stay still until I turn the knob, and second how do I get the angle in whole numbers??

View 3 Replies

Using Tracking Pixels In Flash?

Nov 19, 2009

Got a question from a fellow designer about the use of Tracking Pixels in Flash. Does anyone use tracking pixels in their Flash creatives? If so, how/where do you embed them?

View 2 Replies

IDE :: Using Full Pixels In Flash?

Feb 10, 2009

Is there any way of forcing Flash 8 to use full pixels like photoshop?for instance. I want a button on X: -140 & Y: -30. This is the way I'm used to in photoshop but in Flash you can use (X: -140.5). It takes so much time to remove all these half pixels.

View 2 Replies

Flash :: Css - Physical Screen Pixels With CSS

Feb 9, 2011

I have a Flash object that I need to embed in a page, and I've got it in a wrapper div that is styled to the exact width of the object: 323px. The problem I have is that when I zoom the whole page in the browser (for example, by using ctrl+mouse wheel, or ctrl++ or ctrl+-, the wrapper div zooms, while the flash object does not. Is there a way that I can specify a width in physical screen pixels, so when I zoom in or out, the wrapper div stays the size of the Flash object?

View 1 Replies

IDE :: Create A Grid Containing Pixels In Flash?

May 10, 2009

How can we create a grid containing pixels in flash . for example A square contains a matrix of 4X4 pixel grids and these gids must be visible like sudoku board.

View 1 Replies

Flash :: Set CopyPixels To Ignore Transparent Pixels?

Mar 17, 2011

I have a BitmapData object with transparency (the sourceBitmapData parameter). Every time I use copyPixels() to copy it onto another BitmapData object the transparent pixels replace whatever is beneath them. I would like the copyPixels() function to simply ignore these fully transparent pixels (0x00) and NOT copy themBTW, I've tried setting the alphaMerge to true but that doesn't solve the issue - the whole source object just goes black and ignores ALL transparency.EDIT:

Here are the code snippets;
var b:UIComponent = new UIComponent();
b.graphics.beginFill(color, opacity);

[code].....

View 3 Replies

Flash :: Trim Away The Transparent Pixels Of The Image?

Nov 16, 2011

I have a Flash fla file that contains a whole lot of images. The majority of each image is composed of transparent pixels with a visual object in there somewhere. Each image at the moment is at {x:0, y:0}.I want to trim away the transparent pixels of the image down to a minimum bounding box, but keep the object at the same global position. This requires shifting the trimmed image to the global position of the object in the untrimmed image.This is not so much a problem, but the fact that the images are all contained in a fla is the problem. The options I see at the moment are:

investigate JSFL, the Bitmap object has a getPixels, this in combination with a selection and delete operation could work save the fla to xfl and enumerate the images and associated xml with something like Ruby + image processing lib

Questions: Does anyone know upfront if this operation is possible in JSFL? Have anyone done much automated processing of xfl files? Is there an off the shelf image processor that can perform this trimming operation?

View 3 Replies

Flash 10 :: Change Height Of A Textfield To 60 Pixels?

Feb 2, 2012

I want to change the height of a textfield to 60 pixels, without changing the size of the text, and still keeping it centered. When I want to change the size of the texfield, I can change the length, but the height is unfortunately locked. Any ideas? (Unfortunately I can't provide a link or an image, since I haven't made 50 posts)

View 1 Replies

Flash :: Call An Update On The Entire Stage To Remove Any Pixels?

Oct 7, 2010

I have been using the evt.updateAfterEvent() whenever a mouse is clicked.Is it possible to call an update on the entire stage to remove any pixels.which are no longer being used?

View 2 Replies

Flash :: Load An Image Of Size 6000 × 8192 Pixels?

Sep 14, 2011

I am trying to load an image of size 6000 × 8192 pixels which cleary exceeds flash platform limitation for an image.

I am trying which doesn't seem to work.

I have had search around the internet and found few components like BitmapDataUnlimited, and BigAssCanvas but I amn't sure if I can use them for displaying a remote image as none of them seem to have a working implemented example and just the class itself.

View 1 Replies

Flash :: Narrow A Rectangle Within A Sprite To Exclude Transparent Pixels?

Oct 2, 2011

I have a Sprite that contains opaque objects surrounded by transparent pixels. I also have a Rectangle that represents a part of the Sprite that I want to render using BitmapData.draw(). The problem is that the Rectangle that I obtained also contains transparent parts. How can I narrow the Rectangle to only include the opaque parts and ignore the transparent surroundings?

kapep's answer is just what I want to do, but the problem is that the source is a Sprite, not a BitmapData object, and I don't have getColorBoundsRect() on a Sprite.

View 2 Replies

IDE :: Change The Font Size In Flash CS5 To Show In Pixels Rather Than Points?

Jun 19, 2003

How can I change the font size in flash CS5 to show in pixels rather than points?

View 1 Replies

Flash :: Font Rendering In Flex Sometimes Results In Characters A Couple Pixels Lower

Oct 31, 2009

Sometimes while typing in a textarea in Flex many characters will be rendered at one height then at some point on that same text line the rest of the characters are rendered a couple pixels lower than the rest. Here is an example, look at the last 'I' character, its low:

Sometimes changing the font size will fix this but its not consistent and its not something I can detect (and fix even if I could). Anybody got an idea why this happens? It happens for embedded and non-embedded fonts.

View 1 Replies

ActionScript 3.0 :: Read RGB Values Of Webpage's Screen Pixels Directly Underneath Of Flash Widget?

Oct 26, 2009

How do you read the RGB values of a webpage's screen pixels directly underneath of a Flash widget?

View 1 Replies

ActionScript 2.0 :: FMX : Make A Button In Flash - Font Doesnt Accually Move But It Looks Like A Few Pixels Get Bumped Around?

Jan 5, 2003

How come when you make a button in flash, and you roll over it . the font seems to move some. It doesnt accually MOVE but it looks like a few pixels get bumped around. Its the wierdest thing.

View 3 Replies

Set Stage To 12,00 Pixels?

Feb 18, 2011

I need to cretae a flash banner for a footbal marquee that is over 12,000 pixels wide.how do I make the stage that big? when I try it says I can only make the stage 8,000 pixels wide

View 4 Replies

Snap Guides To Pixels?

Jan 11, 2008

I want to be able to snap the guides to pixels the way you can in Photoshop by holding Shift. Is it possible?

View 2 Replies

Professional :: How To Get Square Pixels

Jul 23, 2010

if I set the stage to be 800 px X 800 px, it does not appear square, neither does holding shift + drawing a rectangle.  However, drawing an oval and holding shift seems to create a circle(though it could be I can't notice it because it's too small).  Is there some way to make these appear square? 

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved