ActionScript 3.0 :: Use Percent Values In As3
Jan 11, 2010like object.width = 20% but that does not work
View 9 Replieslike object.width = 20% but that does not work
View 9 RepliesI want to allow the swf to scale when the browser window is resized, but I don't want it to increase over 100% (so it should only scale down).This is an example of the kind of scaling the client wants:[URL]But again, it should stop at 100% going up.
View 1 Replieswhats wrong with this code:
Code:
var: myMCL:MovieClipLoader = new MovieClipLoader();
myMCL1 = new Object();
myMCL.addListener(myMCL1);
[Code]....
I need to convert a value that I have loaded from an ArcGIS Server and convert it to a percentage. The data loads just fine and on the mouse over I see the correct data I just need to make it a percentage on line 27.
I am using Flash Builder 4 and the ArcGIS API for Flex.
[Code]...
I have a vertical list of movieclips added to the stage all spaced out evenly from top to bottom based of the last movieclips position. I also have defined a center Y point which I would like to find out the percentage of each clip away from that center point. The reason for this number is to scale everything from the center point which is scale 1 then they next item from the center would scale to a percentage from the center point. each clips scaling percentage would be based off of how far they are from the center point in each direction. Keeping in mind the center point is always scale to 1. I also want to make sure my scale never goes below 0.3 so the range has to be between 0.3 and 1 my centerY is also not half the height of the content but a number I decide. AS it the content might be 1000 in height but the center point could be set to 300.
[Code]...
I have got a game with 10 input boxes and I want to diplay the percent scored of the 10 then if they do three games a bonus level occurs so if anyone can point me to a tutorial where i might learn how to do this
View 7 RepliesThe buttons are all set up in Action Script and not placed on the timeline at all.Here is the code for postion on the buttons.I do not want to move the buttons by PixelsI would like to move the buttons by Perectage so it will look the same on all computer monitors.The person that I am editing the file for would like them in the bottom left of the screen.Here I have moved them by Pixels but these buttons do not appear in the same place on all monitors.
///////let's set the position of
the buttons across the bottom of the screen
b1.move(-350,150);
[code]......
My Flash animation using 100% CPU. I don't know why? It is a simple animation i.e. done in an ecard at: Valentine Ecard. I have not used any script in it nor it has too much animation in it. The frame rate is 12.
View 0 Replies how I could go about reversing percent loaded so it goes from 1 - 0 instead of 0-1. I tried
ActionScript Code:
var percent:Number = evt.bytesLoaded/evt.bytesTotal;
trace(" num = "+ Math.abs((percent - 1)));
I've been working with this tutorial and have got it to work for the most part: [URL]. However the preload bar doesn't start until around 30%. After that, it works great. Is there any reason it wouldn't be displaying the bar right off the bat?
View 6 RepliesI've been trying to do this for awhile, and I've read the boards. I've seen a few options as to how to do this, but some of them do not explain how the css/js etc work, and I just don't understand that stuff enough to go it alone.
What I'm trying to do : Create a flash site that only 'downsizes' when the browser is too small to view it. I don't want it to upscale/upsize.
For example. The movie is 1000 x 800 . If a viewer has a viewable area that is less than 1000x800 the movie will scale [ the way it does when published at 100% ]. BUT if the viewer say has a 23' cinema screen, the movie will not get bigger than 1000x800.
I Can simulate in flash file but not happen but when test on IE it's stay on 0%.
PHP Code:
stop();
this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
function loadComplete(e:Event) {
// load complete - remove listeners and move on
[Code] .....
im using the current code on an mc to fade in
[AS]onClipEvent(load){
this._alpha = 0
fadespeed = 15;
}
onClipEvent(enterFrame){
_alpha += fadespeed;
} [/AS]
how can i make this increment until it reaches 75% instead of 100?
When I try to load an xml file it gets stuck at 100%. It never completes. Does anyone know what to do about that? The code:
[CODE]....
I'm fairly new to flash especially AS3 and I'm trying to make a MC width 100% with the color changing (tint) but I want the rest of my content to remain a fixed size/non scalable and centered. I've seen this tutorial [URL] but don't have a clue where to start.
View 1 RepliesI am trying to load html into a text box from a website. when i load to the text box, everything goes fine except that it is loaded as something that looks like this:
"%20Cheese%20Croissant= %3B%3Cimg%20src=%22http%3A%2F%2Fwww%2Ehousi ng%2Eumich%2Eedu%2Fdining%2Fmenus%2Fm%2Dfit%2Egif%22%20alt%3D%22%2A%22 %3E%3C%2Fdiv%3E%3Cdiv%20class%3D%22Desserts%22%3EOat%20Bran..."
I wouldnt mind if the html tags were there, because I can deal with those, but I don't know what to do with this. Here is my loader:
[Code]...
I am trying to set masks and other component positions in relation to Stage size.AS3 CS5I trace stage.stageWidth on a 800x600 pixel stage and I get - 100My stage will scale within a Director piece.Is this a bug? Modal condition? Releated to scaling??
View 7 RepliesFirst of all I know there is a spark VolumeBar component but, for design requirements I can't use it..
I'm trying to create a custom component but heights are not responding as should. [Update] This is were I call the class
<components:VolumeSlider steps="4" height="100" /> The problem is that the volume slider is adapting perfectly, but My custom items component doesn't.
[Code]...
I have an AIR application, I use SwfLoader to load another swf file to display in this app. The problem is the CPU Usage always takes over 50%, but it only takes 15% when the swf file runs in standalone mode.
View 1 RepliesWhat is the best way to determine the percent value of a color between two given values. In other words, what is the best way to calculate the % position of color C?
Color A - 0x0000FF
Color B - 0x00CCFF
Color C - 0x00FFFF
I'm loading an External JPG into an empty MC and I am trying to attach a preloader to show my visitors there is content loading.Layer 1 is Dynamic Text box - instance percent7Layer 2 is empty MC - instance of imageLoader7Layer 3 is my script.
Code:
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
[code].....
I am looking to make a 100% deterministic Flash simulation (for multiplayer RTS game). So far areas that require special attention identified:
ActionScript Code:
Math.random() // obviously, have to use Seeded random
Number // floats are volatile, but that can be overcome by truncating precision
For.. in and For Each loops: // the order of looping through properties on an Object is different every time
I've created a preloader in which an object moves along a curve. I want this object to move as the percentage increases, much like a loading bar would increase as the percent loaded goes up. right now my object moves over 3 seconds and not percentage.[code]...
View 0 Replieshow can I made a multiple preloader for various swf with a percent bar and the names of the swf, just like I have seen at [url]...?
View 2 RepliesHow to display percent sign (%) in dynamic text field that loads from external text file ?
In attachment is example.
How to show the Progress bar at 0%, as it currently shows around 50%+ rather than starting at 0%.
View 3 RepliesDoes anyone know how to have a preloader that shows a percent indicator when you are caching a shared library. The way I have it set up now is on the first frame of my main swf.playback is stopped until the trigger.swf (which calls the sharedlibrary.swf via the loadClip method) is cached. While it's stopped I just have a screen that says "now loading" (which is just some text on the main time line's keyframe) but I was wondering if there was a way to add a nice percent preloader instead. If anyone has read the book Flash 8 Beyond the Basics fromhey'll will probably know what I am talking about. I assume the script would need to monitor the caching of the shared library
View 2 RepliesI have a dynamic text field that is getting its string from a loaded flashvar in the HTML that loads the movie.
Here is my code
Code:
var message1txt:String = LoaderInfo(this.root.loaderInfo).parameters.message1txt;
factbar_mc.factbar_messages_mc.message_anim_mc.message1_txt.htmlText = message1txt;
I have tried embedding code, using device fonts... etc. Nothing is working...
I want to make:
- a flash header with a cityscape moving from left to right behind a transparent logo
- the header will be included in a html-template with a width of 100%
- theh content of the website will be center-aligned (950px wide)
How do I make sure that:
- the cityscape moves over the full width of the screen, regardless of the size of the screen?
- the logo remains correctly positioned?
Click here to see how it looks as a non-moving version: [URL]
When I try to load an xml file it gets stuck at 100%. It never completes.Does anyone know what to do about that? The code:
Code:
private function onProgress(event:ProgressEvent):void {
var loaded:Number = loader.contentLoaderInfo.bytesLoaded;
[code].....