Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Decimal Point Display Not Working.. Why Why?


i am using flash5.

why is it that in debug mode or test mode the decimal points are displayed correctly but in the swf file displayed values do not have the decimal values.

what i am trying to do..
flash file has a draggable slider where the _x value is used to calculate a value which is display on screen using

e.g.
if (int(slider._x+0)>100) {
_root[_name+"slider"] = 30.0;
} else {
bmix = (Math.round((slider._x*10)+1000, 4)/10)+30.0;
_root[_name + "slider"] = (Math.round((slider._x*100)+10000, 5)/100)+30.0;
_root["bmi"] = (bmix/(_root["yslider"]*_root["yslider"]))
}

where _name+"slider" is displayed on screen using a variable with this name.




FlashKit > Flash Help > Flash ActionScript
Posted on: 04-03-2002, 01:49 AM


View Complete Forum Thread with Replies

Sponsored Links:

Getting Rid Of Decimal Point?
I created a simple calculator here http://www.alamofitness.com/macrocalc.html

I would like to know how to make each result in the 3 bottom fields,
show up as whole numbers instead of decimals. For example, if i enter
3200 calories,60 carb,10 protein, and 30 fat, the amount of fat shows
up as 106.6666667. I would like it to round up to 107

thanks

View Replies !    View Related
Decimal Point Problem
Iam in the process of building an eshop and have a small prob with my sub_total text box, when you add item to cart at a value of 3.90 my sub_total text box shows it as 3.9 missing the zero, can any one help

Ive enclosed a sample of the coding Iam using.

Tar in advance.......

View Replies !    View Related
AS2.0 Printing Decimal Point
hello,

as in C++ you may find a keyword called fixed and showpoint. i was wondering if anyone knows what this keywords would be in AS2.0?

these two keywords basically allow to you to set a decimal point in numbers when printing or output.

i know AS2.0 has the floatparcer method, but that is not quite what i am looking for,cuz i want it to stop at the .00 place.

thank you
Hector

View Replies !    View Related
Decimal Point Question
I have created an dynamic text box that I want to use to display a number based on a calculation. The number that I want to display must be in dollars and cents (0.00). The calculation that I have created works fine, but it rounds off to the tenths place (0.0). What can I do to extend it to include the hundredths place?

Thanks!

View Replies !    View Related
Decimal Point Issue
Hi, i have a preloader that calculates the % loaded. Simple, but i am getting a % number with multiple decimal points, i would like it to just show full integers or maybe 1 decimal. Can anyone revise my code (below) to do this.
that would be great, thanks alot

mark

function navReleaseFcn () {
this.onEnterFrame = function () {
percentage = top.getBytesLoaded()/top.getBytesTotal() * 100;
preloader.text = percentage + '%';
if (percentage == 100 && this.getBytesLoaded() > 100) {
onEnterFrame = false;
}
}
}

View Replies !    View Related
Decimal Point Madness
Just a small thing.

I'm doing alot of AS sprite movements and the velocity values I get are stretching to 14 decimal points.

Does anyone know whether this has any impact on performance? Looking at the sheer number of characters runing down my output window, I think it might when I have lots of sprites moving around.

Then again, if I run a function reducing the number of decimals, then that will probably have more impact on performance! Or would it?


ActionScript Code:
function reduceDec(num):Number {
    var myNum:Number = Math.round(num*100)/100;
    return myNum;
}

View Replies !    View Related
[AS] Show The Decimal Point
Morning all!

I hoping this can be solved quite simply :

How can the decimal point be made to show within a variable?
ie. 21.456 - the point shows when the variable is traced via output but within the movie the point is removed.

Does anyone know a simple way to show this point??

Thanks in advance,
Mutley

View Replies !    View Related
Eliminating A Zero Behind A Decimal Point (using Function)
I have a dynamic text box that displays the sum of variables formated in currency form ($77,777.777). Script is in a function.

Sometimes I need to show answers that are in the thousandths.
That's why I have three spaces after the decimal point, but some answers don't need the 3rd place behind the decimal point.
ex: $1,540.890 should display as $1,540.89

How would I eliminate this zero while retaining the thousandths spot for answears that need it?

Here's my code:

function FormatAsDollars (amount, isCents) {
if (isNan(amount)) {
return "0";
}

if (isCents != "isCents") {
amount = amount*1000;
amount = Math.round(amount);
}
amount = String(Math.floor(amount));

if (amount.length == 1) {
return ("0.0"+amount);
}

if (amount.length == 2) {
return ("0."+amount);
}

if (amount.length == 3) {
return ("0."+amount);
}

cents = amount.slice(-3);
amount = amount.substring(0, amount.length-3);

dollars = [];
do {
dollars.push(amount.slice(-3));
amount = amount.substring(0, amount.length-3);
} while (amount.length>3);

if (amount.length) {
dollars.push(amount);
}

return (dollars.join()+"."+cents);
}

// Thanks,
// Pooglins

View Replies !    View Related
Adding A Zero After Decimal Point In Totals?
Hi, new here so sorry if this is a very basic question.

I'm making a money-bank game where coins get dragged across to the piggy-bank and the total is displayed throughout.

My problem is that, if say the amount is 10p, it is displayed as 0.1 rather than 0.10, or 1.1 for £1.10 etc. It would be great if I could get something to recognise those situations - adding 0 to make 0.10 - but not, say, to make 11p into 0.110.

I put in some seriously clunky code which checked if the amount was a specific number (such as 0.1, 0.2, 0.3 etc) and told it to add a 0 on, but I'm sure there must be a simpler way of doing this? Specifically to maybe try and get it to only scan the number AFTER the decimal point and if there's only 1 number there, then add a 0 on afterwards to display the correct amount.

I have a vague feeling it might have something to do with charAt(), but I'm not sure - it's not something I've looked at before. So any suggestions/help would be really appreciated.

View Replies !    View Related
Evaluate The Decimal Point Of An Interger
Hey all,

I need to evaluate the decimal point of an interger (bet u wouldn't of guessed that from the title eh?!)

So, im reading in XML for a thumbnail viewer, the viewer displays 5 thumbs per "page" so, i divide the total number of thumbs by 5.

Then i need to evaluate the number if it dosn't have a decimal point (ie, the total divides by 5 exactly) then that is the number of pages i need.

Then if the number does have a decimal 12.2, for instance i need to strip the 2. leaving 12, and then add one so the 2 images left go onto a new page.

Hope you can understand my ramblings.

Cheers in advance. Andy.

View Replies !    View Related
Setting Numbers Before The Decimal Point To 0
Hello all,

I am wonder how one could set the numbers before the decimal point to 0.

For example, if i have 23842348.000389384, then i would get 0.000389384.
As another example, if i have 15264.985653, then i would get 0.985653.

I have tried converting the number to a string, splitting it into an array by the decimal point.
But in that case, if the decimal has got zeroes in front, they get truncated.

Any ideas appreciated

cheers!

View Replies !    View Related
Setting The Length Of Decimals (after Decimal Point)
Howdi guys.
Watching big brother Final are we all?

Anyway, I have a simple question here. How do you round a variable number off to a certain amount of points? I already know how to round it off to a whole number.

Thanx a million in advance.

View Replies !    View Related
How In Tarnations Do I Get Bytes Loaded With Decimal Point?
I have a preloader with a little byte counter in it.
It works great!
But, how do I also include a decimal point & numbers following?

Here's what I have for the actionscript for the first frame.

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
ifFrameLoaded ("ftp") {
}

Thanks,
~senior pooglins

View Replies !    View Related
Generate A Random Number, To A Certain Decimal Point
Howdy is there anyway to generate a random number (within a range), to a certain decimal point and then display it in a text box?

I know how to do a full number, but am struggling to find out how you get random numbers with decimals.

Thanks in advance.

View Replies !    View Related
Generate A Random Number, To A Certain Decimal Point
Howdy is there anyway to generate a random number (within a range), to a certain decimal point and then display it in a text box?

I know how to do a full number, but am struggling to find out how you get random numbers with decimals.

Thanks in advance.

View Replies !    View Related
Input Box Comma To Decimal Point Change Help
Ok i got an input box when the user enters a money value i.e. 3.00 or 3,00 i need the comma symbol to be converted into a decimal symbol , how can i write a check for the comma and how can i convert it to a decimal point and put the result back into the text box so its instant as soon as a , is entered.

View Replies !    View Related
How Do I NOT Display Decimal Places If They Are 0?
I am trying to make a small enhancement to some code. I need to modify a number so that if the last decimal place is 0 then it wont display it.

10.00 would be 10
10.10 would be 10.1
10.11 would remail 10.11

I am setting the decimal places to 2 using

Code:
strNum = Math.formatDecimals(intNum, precision);
But what I really want is a method that will set the max number of decimal places to be 2, and when there are 0's that it wont display them.

Is there any easy way to do this?

View Replies !    View Related
Display Var To A Certain Amount Of Decimal Points
in other languages i have used this was called the using function and it might be the same in flash, so basicaly if you dont get what i mean i mean, if some vars contain....

var1 = 45.456
var2 = 45.5

i want to change them to display only the first two decimal points, and if they are less than 2 decimal points long at the end add one so...

var1 = 45.45
var2 = 45.50

if you cant actualy change the vars to this, at least tell me there is a way to display it in a dynamic text like this. thanks for helping if you do

View Replies !    View Related
Working With Decimal Places
Hey there

I have a Number type variable that is outputting as 3.46666666 I want it to round it up to 1 decimal place ie 3.6 so I can display it in a text field what do I do any ideas?

View Replies !    View Related
Rounding To Decimal Places Not Working For Me
Hi all, Ive got a slightly complex quiz up and running which has 8 answers to a question and requires each one to put in the number of people who feel that the said answer is most relevant to the question. These 8 answers are put into their own text box which works out a percentage of the 8. I need to show 2 decimal places but it wont seem to let me, maybe because my code is messy, im not sure!! any ideas?
cheers

Code:
onClipEvent (enterFrame) {
_root.agree2 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgb)*100)/100;
_root.agree3 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgc)*100)/100;
_root.agree4 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgd)*100)/100;
_root.agree5 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAge)*100)/100;
_root.agree6 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgf)*100)/100;
_root.agree7 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgg)*100)/100;
_root.agree8 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgh)*100)/100;
_root.agree9 = int(int((100/((int(_root.enterAgb))+(int(_root.enterAgc))+(int(_root.enterAgd))+(int(_root.enterAge))+(int(_root.enterAgf))+(int(_root.enterAgg))+(int(_root.enterAgh))+(int(_root.enterAgi))))*_root.enterAgi)*100)/100;


for (i=1; i<13; i++) {
if (_root["agbar"+i]._xscale<_root["agree"+i]) {
_root["agbar"+i]._xscale = _root["agbar"+i]._xscale+1;
}
// end if
if (_root["agbar"+i]._xscale>_root["agree"+i]) {
_root["agbar"+i]._xscale = _root["agbar"+i]._xscale-1;
}
// end if }
}

View Replies !    View Related
Media Display Cue Point
hello,
i'm trying to use a media display component that displays a video.
after 10 seconds into the movie i'd like the main timeline to jump to a certain label.
tried to do it using a cue point but the help notes only gets me so far...
could someone walk through it?

View Replies !    View Related
[F8] Display Hyperlink When Cue Point Is Reached
I have a video with cue point events added to it. I want a text hyperlink to appear to the right of the video when the first cue point is hit. When subsequent cue points are reached, links will append below the first link and display throughout the movie.

I am really struggling with the actionscript and could use some guidance. Does anyone have a snippit of code that does this that I could have a look at?

Thanks!

View Replies !    View Related
Angle Calculation, Display And Pivot Point
Hello,

I have a project and I'm really stuck on a direction to move.

(See attached pic) I have 2 lines (line M and L). A line intersects both with a point (point A) sitting on line M. I'd like to have the user move point A along the x axis using the point on line L as a pivot. Finally I'd like to show the angle (in degrees) of the interior angles (angles 1, 2, 3, and 4 in the pic)

I've been reading about the atan2 method to calculate angles but cant seem to wrap my brain around it. I'm also having difficulty figuring out how to set the pivot point.

Can someone point me in the right direction on where to start.

Thanks for any help

G













Attached Images

View Replies !    View Related
Function To Display Hyperlink When Cue Point Is Reached
I have a video with cue point events added to it. I want a text hyperlink to appear to the right of the video when the first cue point is hit. When subsequent cue points are reached, links will append below the first link and display throughout the movie.

I am really struggling with the actionscript and could use some guidance. I have taken many tutorials now and am starting to get my hands wrapped around flash video, but can't make this work. ARG!

Thanks,
-S

View Replies !    View Related
Key In Longtitude And Latitude To Display A Circle Point On The Map
I wanna create a program that allow users to key in the longitude and latitude. After users key in the two coordinates, a flag will be display on the map based on the two coordinates and show a predefined distance of coverage area(a circle).

I am thinking this can be done using flash. Is there any tutorial to guide this kind of application development?

Thanks in advance.

View Replies !    View Related
Cue Point Event To Display Text Link In Movie
HI -- This may be a fairly mundane question but I am having a hard time figuring it out. I have a movie with several cue point events. I would like a text link to be added to the right of the movie when a certain cue point is hit. I would like the link to stay in place and each time a new cue point is hit, a new link is added below the last link.

I am stuck and can't seem to get this to work. Having a hard time figuring out the action script. Any suggestions? I have already followed the macromedia tutorials on this subject and am just floundering.

thanks!

View Replies !    View Related
Point'n'click Navigation Not Working Right...
I have a problem with my point'n'click navigation setup. After adding speed formulas, my object doesn't move down any more...

I am using Flash MX (educational version).

Could anyone help me find out what the problem is?

View Replies !    View Related
.draw(MovieClip) Not Working With Centered Registration Point
Hey guys, kinda new to the forums but you've saved my asses before! So here's another el questidentia:


Code:
var mc1:MovieClip = this.attachMovie("libname", "libname", 0);
trace(mc1._width); //traces the width fine

var bmd:BitmapData = new BitmapData(mc1._width, mc1._height);
bmd.draw(mc1);
Now, my problem: mc1 has a centered registration point and I'm only getting the bottom right-hand quadrant of the movieclip drawn to bmd.

I've tried to fool around with the Rectangle in the .draw() method:

Code:
bmd.draw(mc1, new Matrix(), new ColorTransform(), "normal", new Rectangle(x, y, 250,250));
But this doesn't seem to work...it will only ever clip the Rectangle(0, 0, 250, 250) from mc1! It will move this rectangle of data from mc1 to (x, y) of bmd, and that's handy but not what I need...

I can fix this problem by moving all the content in mc1 into the bottom right quadrant, but this makes other problems with rotating mc1 (I would like it to stay centered).

I have found a bit of a workaround by putting the clip into a bottom right hand quadrant of an empty clip and drawing that:


Code:
var mc1:MovieClip = this.createEmptyMovieClip("name", 0);
var mc2:MovieClip = mc1.attachMovie("libname", "libname", 0);
mc2._x = mc2._width * 0.5;
mc2._y = mc2._height * 0.5;

var bmd:BitmapData = new BitmapData(mc1._width, mc1._height);
bmd.draw(mc1);
But this is still kind of ugly...*crosses fingers for a more elegant solution*

Solve the riddle and win a prize! (my profound thanks, and a gift certificate to dev/null)

View Replies !    View Related
Display Date Not Working?
Hi all,

I'm using this code to display the day, month and year:


Code:
nuDate = new Date();
numMonth = nuDate.getMonth();
if (numMonth == 1) { wordMonth = "January" }
else if (numMonth == 2) { wordMonth = "February" }
else if (numMonth == 3) { wordMonth = "March" }
else if (numMonth == 4) { wordMonth = "April" }
else if (numMonth == 5) { wordMonth = "May" }
else if (numMonth == 6) { wordMonth = "June" }
else if (numMonth == 7) { wordMonth = "July" }
else if (numMonth == 8) { wordMonth = "August" }
else if (numMonth == 9) { wordMonth = "September" }
else if (numMonth == 10) { wordMonth = "October" }
else if (numMonth == 11) { wordMonth = "November" }
else if (numMonth == 12) { wordMonth = "December" }

displayDay = nuDate.getDate();
displayYear = nuDate.getFullYear();

//trace(displayDay + " " + wordMonth + " " + displayYear);
this.dateText = (displayDay + " " + wordMonth + " " + displayYear);


When I used the trace, it displays the date as it should (16 March 2006), but if I try to use it on a dynamic text field, with the va "dateText", it only displays "February".

Can anyone tell me why?

View Replies !    View Related
Working With Display Objects
I'm having an issue with finding the correct components in my program to refresh on a canvas and it seems the entire component is being considered a display object. So, I come here after reading tutorials and having no luck.

Example of my code:

Something.as

ActionScript Code:
initComponent()
{

//initialize an image
this.addChild(img);

//initialize a second image
this.addChild(img2);

//initialize a label
this.addChild(label);

}

This object is then displayed on a canvas, and I'm trying to access one of the images to toggle the visibility of the image to on and off. However, I've been unsuccessful thus far.

From the file I'm working with I can create an array of children of Display Objects in such a format:

var arr:Array = thing.getChildren();

and I can assign each child to a variable, and when I get the name of each of the objects, they are the class Something + a number, but I can't access anything within the display object. Obviously, I'm doing something wrong, but how do you access each of the three components that I added after the object has been created?

Thanks for the help.

View Replies !    View Related
Working With The New Display List
Hi all,

I'm quite new to AS3 so please bear with me. I have read that the attachMovie has been replaced by addChild. I'm not sure how this works though. Basically I have a document class in which I have all my game code, I have movie clip symbol in my library which I need to follow the mouse but how? Obviously I will use startDrag but how do I get the symbol into the display list or the document class???

Please help, very confused!

Lar

View Replies !    View Related
Working With Parameters And Methods Of Display Com
I have the following code in a function that resides on _level0 of my application.

I am loading moviDisplay01.swf which I created to host a media player for movies. Right now the movie is hard coded into the sample. Later on I will use a parameter passed to the function.

moviDisplay01.swf contains a Display component called "moviDisplay" along with buttons to manage playback (I did not use a controller component).

ActionScript:


ActionScript Code:
loadMovieNum("movieDisplay01.swf",50);
_level50.moviDisplay.autoPlay = false;
_level50.moviDisplay.active;
_level50.moviDisplay.setMedia("movirama_hi.flv","FLV");
_level50.moviDisplay.addCuePoint("start",0)
_level50.moviDisplay.stop();


I do not have a streaming server available, but I do want to manage the tracking of loading of the movie in movieDisplay01.swf. I have prepared some code to do this.

The behavior of the resulting application is as follows:

The new level is created and the .swf file loads as expected. However, "movirama_hi.flv" is not loaded.

And in debug mode, reviewing the variables associated with "moviDisplay" component do not appear to be adjusted as the code above is attempting to do.

Is it not possible to set Display component parameters or invoke methods on this component when it is loaded on a _level?

BTW, this all works fine when the code resides only in "movieDisplay01.swf".

Any insight would be welcome. Also, if there is a better way to accomplish the same thing, I'd be interested in hearing about it.

FYI, I am using Flash MX 2004.

Thanks,

Kracko

View Replies !    View Related
A Working Teamspeak Display In Flash
Does anybody know how to get Teamspeak to be displayed in flash or if someone has done this before.

Would anyone be willing to help me create this.

Thanks

Dunkyb123

View Replies !    View Related
Display Variable From Flash In ASP Page Not Working
I've search high and low for a simple answer and am now at my wits end.

I just want to take a single variable from a flash file, and using getURL, send it to an asp file to display the results.

I have tried attaching the string in the URL:
getURL("webpage.asp?var=anything", "_blank)
This resulting URL seems to ignore everything from the "?" and on.

I have tried just using the web page link w/ both GET and POST methods and using request("var") and request.querystring("var"):
getURL("webpage.asp","_blank", "POST")
The result w/ POST is the web page comes up but launches the web page as if it were a text file, and GET doesn't even launch the web page at all.

Using loadVars or any of its counterparts does not seem to do anything at all...does not launch a web page w/ the results.

It's soooo simple to send a single variable from asp to Flash using the querystring ... why is it not the same going from Flash to asp??????

Please help!

View Replies !    View Related
HTML Field Display Not Working Properly On Net
I'm using an XML file to dynamically load info into a textfield which is .html = true and htmlText is placed into the field. One such entry looks like the following:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<glossary>
<entry>
<term>Rural</term>
<definition><![CDATA[According to the Arizona Department of Health Services, 'frontier' areas are defined as having less than seven (7) residents per square mile of land. 'Rural' areas have less than 15 residents per square mile of land (ADHS, April 2005).<li>Arizona has 4 frontier counties and 4 rural counties. A total of 10.7% </li>]]></definition>
</entry>

</glossary>

This works fine when playing back locally on preview in Flash. On the net, it actually shows the html markup, despite having the field set as html and using htmlText to populate the filed. Flashplayer 9 all around. Any ideas?

View Replies !    View Related
Timecode Not Working (display Time In Movieplayer)
Hello,

If anyone can help :). I'm using Lee's timecode class (http://theflashblog.com/?p=15). But it is not working. I'm trying to get the current and total time working in a dynamic textField. But it is not working yet.

Testing, reading and trying for hours and hours. I need some sleep ;)
Does anyone has tips/suggestions? Thanks in advance!!

Here is my code:
Code:

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(30);
theVideo.attachVideo(ns);

ns.play(videoURL);
ns.pause(true);

var tc:Timecode = new Timecode(ns);
timecode_txt.autoSize = true;
timecode_txt.selectable = false;
this.onEnterFrame = function() {
timecode_txt.text = tc.getTimecode();

}

ns.onStatus = function(info) {
   if(info.code == "NetStream.Buffer.Full") {
      bufferClip._visible = false;
   }
   if(info.code == "NetStream.Buffer.Empty") {
      bufferClip._visible = true;
   }
   if(info.code == "NetStream.Play.Stop") {
      ns.seek(0);
   }
}

function videoID() {
   getURL(videoURL);
}

playBut.onRelease = function() {
   ns.pause();
}

rewindButton.onRelease = function() {
   ns.seek(0);
}

var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;

ns["onMetaData"] = function(obj) {
   duration = obj.duration;
}

function videoStatus() {
   amountLoaded = ns.bytesLoaded / ns.bytesTotal;
   loader.loadbar._width = amountLoaded * 228;
   loader.scrub._x = ns.time / duration * 228;
}

var scrubInterval;

loader.scrub.onPress = function() {
   clearInterval(videoInterval);
   scrubInterval = setInterval(scrubit,10);
   this.startDrag(false,-2.4,this._y,223,this._y);
}

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
   clearInterval(scrubInterval);
   videoInterval = setInterval(videoStatus,100);
   this.stopDrag();
}

function scrubit() {
   ns.seek(Math.floor((loader.scrub._x/228)*duration));
}

var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;

var item1:ContextMenuItem = new ContextMenuItem("::::: Video Options:::::",trace);
theMenu.customItems[0] = item1;

var item2:ContextMenuItem = new ContextMenuItem("Play/ Pause Video",pauseIt,true);
theMenu.customItems[1] = item2;

var item3:ContextMenuItem = new ContextMenuItem("Restart Video",restartIt);
theMenu.customItems[2] = item3;


function pauseIt() {
   ns.pause();
}

function stopIt() {
   ns.seek(0);
   ns.pause();
}

function restartIt() {
   ns.seek(0);
}

_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);

var so:Sound = new Sound(vSound);

so.setVolume(100);

mute.onRollOver = function() {
   if(so.getVolume()== 100) {
      this.gotoAndStop("onOver");
   }
   else {
      this.gotoAndStop("muteOver");
   }
}

mute.onRollOut = function() {
   if(so.getVolume()== 100) {
      this.gotoAndStop("on");
   }
   else {
      this.gotoAndStop("mute");
   }
}

mute.onRelease = function() {
   if(so.getVolume()== 100) {
      so.setVolume(0);
      this.gotoAndStop("muteOver");
   }
   else {
      so.setVolume(100);
      this.gotoAndStop("onOver");
   }
}

//startlogo from url
myLoader.contentPath = myLogo;
//movietitel from url
my_txt.text = myTitel;


and my Timecode:
Code:

class Timecode {
   function getTimecode(theTime:Number):String {
    if (theTime) {
        var t:Number = Math.round(theTime);
    } else {
        var t:Number = 0;
    }
    var min:Number = Math.floor(t/60);
    var sec:Number = t%60;
    var s:String = "";
    if(min < 10) {
        s += "0";
    }
    if(min >= 1) {
        s += min.toString() + ":";
    }
    else {
        s += "0:";
    }
    if(sec < 10) {
        s += "0";
        s += sec.toString();
    }
    else {
        s += sec.toString();
    }
    return s;
}
   
}

View Replies !    View Related
[F8] Passing PHP To Flash- Trying To Display Image With HTML, Not Working?
My Flash is correctly passing PHP variables to my SWF, but I'm passing a variable with HTML in it, and instead of loading the image, it loads the text, literally.

Here's my PHP file-

<?php
print "myVar=<img src=http://www.tiffanydavisphotography.com/online01.jpg>";
?>

View Replies !    View Related
Creating A Point-line With Increasing & Decreasing Point Size
hi,
i want to creating a point-line with increasing & decreasing point size, that the final result looks like a wave form.
i guess i have to do that with sine and cosine values...?
i would be very happy for any help or hint.

View Replies !    View Related
Draw A Line From Any Point A To Any Point B Dynamically Through Actionscript
I am trying to make a file where there are several locations made on a map. If a person clicks on one location A and then another location B, there is a plane that flies from A to B and there are 2 text fields that get populated with the names of A and B destinations. This animation is scripted. I wanted to animate a dotted line from point A (from destination of the plane) to point B(to destination of the plane) through action script too so that there is a dotted line following the plane animation.

Thanks

Aneesha

View Replies !    View Related
[CS3] Find Highest Point And Farthest Point Of A Parabola
Hi Guys, I've been using for forum extensively over the past few weeks and have found almost everything I needed until now...

I'm moving a ball using something similar to the following code:


Code:
var spx:Number = 3;
var spy:Number = 7;
var g:Number = 0.1;
var bmove:Boolean = true;

onEnterFrame = function() {
if (bmove) {
move_ball();
}
stop_ball();
}

function stop_ball() {
if (ball._y > 350) {
bmove = false;
}
}

function move_ball() {
spy = spy-g;
ball._x += spx;
ball._y -= spy-g;
}
Is there a way to find the maximum height and farthest point of the parabola it describes? I want to display a path guide using curveTo which shows the route of the ball.

Thanks.

View Replies !    View Related
Moving Object From Point A To Point B - Mathematical Problem
Hi,
I have mathematical problem.

I want to move object from point A to point B but not just X or Y aixis. For example point A(0,0) and point B(500,500).

Please if somebody can send me generic equation to put in ON_ENTER_FRAME event so on each frame object is a little bit closer to point B.
Thanks,

View Replies !    View Related
Find Highest Point And Farthest Point Of A Parabola
Hi Guys, I've been using for forum extensively over the past few weeks and have found almost everything I needed until now...

I'm moving a ball using something similar to the following code:


Code:
var spx:Number = 3;
var spy:Number = 7;
var g:Number = 0.1;
var bmove:Boolean = true;

onEnterFrame = function() {
if (bmove) {
move_ball();
}
stop_ball();
}

function stop_ball() {
if (ball._y > 350) {
bmove = false;
}
}

function move_ball() {
spy = spy-g;
ball._x += spx;
ball._y -= spy-g;
}
Is there a way to find the maximum height and farthest point of the parabola it describes? I want to display a path guide using curveTo which shows the route of the ball.

Thanks.

View Replies !    View Related
Drawing Line Dynamically From Point To Point
Here is what I am looking to do, I will try and be specific:

I would like to create an MC:
when loaded, draws a line dynamically from the first x/y point released on the stage to the next x/y point released, then from there to the next x/y point released, and so on. Creating a path from point to point, wherever you release. Tracing the path of the user (based on onRelease points).

This could be a closed set, where, for example, I would have 10 MC's on the stage that are all potential points for the line. The catch is that I want the user to define the order, selecting the MC's in any order and having a line drawn that traces the users selections.

Or it could allow the user to release anywhere within the parent MC.

I am moderately familiar with drawing a line dynamically, but don't know how to write what I am looking for.

Any help??


Thanks so much.

View Replies !    View Related
How To I Move From Point To Point And Leave A Trail
What i'm doing is have a word appear and then a line come from it and move to a point, while the line is moving what i want it to leave a trail behind it as if someone was drawing the line from 1 point to another, I hope i have explained it ok,

If anyone knows how to do this can you let me know.

thank's

View Replies !    View Related
Using Flash Actionscript To Do Point To Point Linkage
hiya..
do anyone has any idea how to using flash actionscript to do a point to point linkage?

View Replies !    View Related
Move An Object From One Point To Another Point On Graph
Basically what I like to ask is how to move a object from one point to another point based on the point tat you have clicked on a graph. For example, If I click on this coordinate (2,3) on graph, the object (movie clip) will move to that point.

View Replies !    View Related
Registration Point Vs. Transformation Point
I'm extremely frustrated with the behavior of Flash MX 2004's registration/transformation points. I just learned that the distinction between the two just happened with the release of Flash MX 2004. I'd like to know how in the world I'm supposed to transform a symbol relative to its corner or side, seeing how the transformation point insists on being in the center of the symbol every time.

Let's say I have a 200x200 square shape. If I want the transformation point to be in the lower left corner, it looks like I have to:

1. Put the registration point in the center when I create the symbol
2. Double click on the symbol
3. Move the shape 100 px to the right
4. Move the shape -100 px up
5. Exit out of symbol editing mode

which is five times more complicated a process than if they had kept the behavior like it was. Or at the very least, change the Symbol Creation dialog box to this:



Or am I missing something?

View Replies !    View Related
Move An Object From One Point To Another Point
Basically what I like to ask is how to move a object from one point to another point based on the point tat you have clicked on a graph. For example, If I click on this coordinate (2,3) on graph, the object (movie clip) will move to that point.

View Replies !    View Related
Laser From Point X Go To To Point Z. Sort Of
ok i need help! here is what i have so far, this code that i show u is on the laser movie clip (it has been duplicated allready and this is just the code that is on it:

Code:
onClipEvent (load) {
this._x = _root.mech._x;
this._y = _root.mech._y;
laserMoveSpeed = 10;
this.targetAngle = Math.atan2(aim._y-mech._y, aim._x-mech._x);
this._rotation = this.targetAngle/(Math.PI/180);
}
onClipEvent (enterFrame) {
//here is code that will move laser in direction of where
//the mc instance named: aim was when clicked
this._x += Math.cos(this.targetAngle)*this.laserMoveSpeed;
this._y += Math.sin(this.targetAngle)*this.laserMoveSpeed;
}

mech is the instance name for the point the laser shot will start at, aim is the mouse mc whhere you click and then it duplicates the mc, and then this code should get run , the only thing that works is when u click, one of the laser mc shows up, so u can keep clicking and u will get tons of lasers on the screen, but they dont move and just stay at the point where the mech was when shot. how come this code isnt making the laser move in the right direction, so why dont it move?
EDIT: on the onload part i just added a trace(targetAngle); it displays the output of NaN. what does that mean>?

View Replies !    View Related
Add Point And Deduce Point In Flash
Hello everyone,

I am a beginner in Flash and currently I am doing my final year project on a website development. I plan to create a happening website by providing members to actually collect points while they perform some activities like membership sign up will earn them 500 points, submit photo will earn them 100 points and so on.

They can collect point under they membership account and use the point to redeem some stuff. As they redeem their point in their account will automatically deduced accordingly. So the problem here is I am unable to figure out what actionscript is this called- able to add points and deduce point according to the activities the member do in the website. I would be really grateful if you guys can help. Really really need help. I have no idea where to start off. Thank you in advance.

cheers

View Replies !    View Related
From Point To Point With Smooth Rotation
I want to max the stage size to 2880x2880 then make a huge symbol with buttons that say move to point x... y... and have this much rotation...

My problem is if I move from point to point how would i get a smooth move not just a jump? With the rotation gradually happening?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved