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




Getting Framerate Of Document Through Actionscript



Hiho

As the title says I need to know the frame rate of the document. Not the real frame rate measured but the framerate defined in the .fla (under Modify->Document->FrameRate).

Is it possible?



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-30-2005, 07:12 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Changing The Framerate Via Actionscript
Im trying to find out if it's possible to change the
framerate of my movie-clip?
I've been looking for some property code that allows you
to set the fps, of the selected movie symbol, or the whole
.swf when hitting a button.

shouldn't be harder than something like this.....
while (on(press)){
TellTarget("mov.symbol"){property.fps("24");}}

I just want to be able to controll the framerate depending on the condition....

yeah... and if u know if its possible to reverse a movie object, through scripting I'd be thankfull too =)

hmm.. guess that's why im asking here..
hope somone can help.

Changing Framerate With Actionscript
Is there a way to change the framerate a movie runs at with actionscript? For example, I could have three buttons, slow, medium fast, which would change the framerate to 6, 12, or 24.

Thanks

Controlling/defining Framerate Using Actionscript
quite simply, is this possible?

sifu

ActionScript Animation Independent Of Framerate
Hi everybody. I'm working on a small piece of ActionScript to help me do motion tweens dynamically. Currently, it uses frames as time input, but I would like to make that seconds.

I'm aware that there are good tweening classes available that do this already, but I simply want to learn how to do this so that I can use it for other things as well.

This is the code so far (simplified and void of unnecessary things):
Code:

function runDemo():Void
{
    MovieClip.prototype.tween = function(a:String, b:Number, f:Number, d:Number):Void
        {
            var c:Number = f - b;
            var t:Number = 0;
            this.onEnterFrame = function()
                {
                    this[a] = ease_quinticInOut(t++, b, c, d);
                    if  (t > d)
                        delete this.onEnterFrame;
                };
        };
   
    function ease_quinticInOut(t:Number, b:Number, c:Number, d:Number):Number
        {
            var ts:Number = (t /= d) * t;
            var tc:Number = ts * t;
            return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);
        };
       
    myMovieClip.tween("_x", 0, 150, 30);
};

runDemo();

As you can see, it tweens myMovieClip in 30 frames. I'd like that to be one second, so that processor lag isn't a factor when I start using this code. I hope you can help me!

Framerate Of Loaded SWF Changing Framerate Of Main Movie?
I don't understand why this is happening, as everywhere I read said this was impossible, but - I have my main movie defined as 24fps.

I use the following code to load in an SWF that happens to be 12fps.

ActionScript Code:
_root.ImageLoop.createEmptyMovieClip("anSWF", _root.ImageLoop.getNextHighestDepth());
    _root.ImageLoop.anSWF.loadMovie("./InsulinClip4plasma_12fps_mx.swf");

As I understand it the main movie should control the framerate so I was terribly shocked when I found my main movie runs at 12fps after loading in that swf.

Does anyone know how I can circumvent this?

Thanks!

Video Framerate / Movie Framerate Issues
Hi all,

I have one swf, say "loader.swf", running at 40 fps loading a video swf, say "video.swf", exported from sorensen squeeze running at 25 fps.

Now, what I thought at first was video.swf would adjust to the framerate of loader.swf, like any other swf would, but it seems that if video.swf contains timeline video or sound, loader.swf will conform to the framerate of video.swf ?

When decompiling the swf from sorensen squeeze there´s also a "framerate=25.00000" action at frame 1. Is this some kind of secret movie property, or just a simple way for loader.swf to get the video framerate?

What happens to loader.swf when i unload media.swf? Will it go back to its original framerate?

Couldnt find any info on these slightly puzzling issues, anyone with experience from this?

Nick

Something Like Document.write In ActionScript?
Is there a way to make something similar in ActionScript?? I want to create an event function for every movieclip that I created dynamicaly.

XML Document Into Flash Using ActionScript
Right then I have been given the task of reading an XML document into Flash using ActionScript.  I have a whole 1 days experience with actionscript and not much more than that in Flash.  in this time i ahve managed to get flash to download the file am now trying to loop through it.

this is what i have so far:

on (release) {
  myXML = new XML();
  myXML.load("arch_sites.xml");
  myXML.ignoreWhite = true;
  function myOnLoad () {
    for (i=0; i<=myXML.childNodes.length; i++) {
      _root.a = myXML.childNodes;
    }
  }
}

when i run this i either get nothing or get all of the xml document output into the textbox a.

this is the format of the xml file that is set in stone by the way:

<?xml version="1.0" encoding="UTF-8"?>
<Sites>
<Site>
<SiteName>a</SiteName>
<XCoord>3560</XCoord>
etc...
</Site>
<Site>
<SiteName>b</SiteName>
<XCoord>0653</XCoord>
etc...
</Site>
</Sites>

what i want to be able to do eventually is to loop through this xml document and only output certain elements, so loop over the whole document and grab some of the XMl elements for instance XCoord one time and then SiteName another time.

can anyone point me to a tutorial that would help me to do this, or give me a few pointers on how this would be achieved?

any help appreciated !

Actionscript Question - Write To Document
Hi

Okey, I'll just describe it first. I've got a flash file which has a grid on it. On the grid, there are several boxes which can be drag/dropped around, locking onto the grid. I need a way for the user to be able to save the location of the boxes somehow.

I am looking for suggestions on how to do this or if it's even possible without flipping the world upside down.

So individual questions would be:

1) is it possible to write to a text document, the location of a certain movieclip and if yes, does anyone have an example code of this?

2) is it possible to write it out directly to a pdf or something like that, which the user can then open separately.

3) if either of the above are possible, would it also be possible to reverse the process and allowing the user to load the file back into the flash (sort of like a loadMovie), so that they may move the boxes around and save it as a new file.

Although this is posted in the AS2 section, I wouldn't mind suggestions for both AS2 and AS3.

Thanks for your time

Writing To A Text Document W/ Actionscript
Hello --

I am curious if something can be done with actionscript...

Basically, I am wondering if there is a way to write to a text document on the users system in order to store variables and/ or XML nodes with attributes.

These documents would, in theory, allow the Flash movie to remember it's states so when a user returns to the site, or tries to save what they had open, the text file could be used to initialize and display the "saved" state.

Wondering if anyone knows any resources for this or even if anyone out there has done something like this. Seems like it should be able to but may'be not. Hopefully there is research out there I can view...

Thanks in advance...

--vagabond007

Writing To A Text Document W/ Actionscript
Hello --

I am curious if something can be done with actionscript...

Basically, I am wondering if there is a way to write to a text document on the users system in order to store variables and/ or XML nodes with attributes.

These documents would, in theory, allow the Flash movie to remember it's states so when a user returns to the site, or tries to save what they had open, the text file could be used to initialize and display the "saved" state.

Wondering if anyone knows any resources for this or even if anyone out there has done something like this. Seems like it should be able to but may'be not. Hopefully there is research out there I can view...

Thanks in advance...

--vagabond007

How Do I Get The Frame Rate Of The Document In ActionScript?
How do I get the frame rate of the document in ActionScript?

Actionscript Code For Downloading Word Document .doc ?
Hi there.

Im getting errors when trying to download a word .doc on my server..

this is what i have on a button

on (release) {
getURL ("http://www.humancapitalu.com/downloads/bell/bridges.doc");
}

tell me what has this numptey (im the numptey !) done wrong..

thanks alot for your help...

Basic ActionScript Question On Document Class
Hey Guys,


Another question related to basic ActionScript3 coding

I wanted to know the difference between having the code in a keyframe actions window and in a document class.

Can everything be written only in a document class?

Thanks in advance

Actionscript For A Button To Print A File/document
What is the actionscript to assign to a button in order to open a file/document that will be included on the same cd rom as my flash EXE interface?

Any help would be appreciated.
Not looking for third party solutions just the scripting required for the flash exe to locate the file from the cdrom and print to the users printer.

Thanks!
Meg

Calling Javascript Document.write From Actionscript Hangs Browser
Whenever the following code is run from Flash, the browser hangs. Any ideas why and does anyone have any possible workarounds where the javascript is all internal to Flash?


ActionScript Code:
ExternalInterface.call('myFunc(){document.write(<style type="text/css">.myDiv{color:#fff;}</style>');

Getting The Document Or Setting The Document Boundaries?
Why can I find no information on this?

How do I findout how big my document is in real time or set the size of it?

FrameRate
Is it possible to control the frameRate of a movieClip, independently of the main movie frameRate?

So if my main movie runs at 60fps, I need my movieClip to run at 25fps.

Also if I'm loading a movie into another movie, can I control the movie frameRate of the movie I'm loading in, to be independant of the host movie.

Thanx

Nick

Right Framerate ?
Hello,
I just wonder, what's the right framerate to use ?!
The moving of my objects really looks smooth with 40fps. I wonder if it's ok using such a high frame rate. Is there a kind of "rule fo thumb" ?
Thanks a lot in advance.
cheers
Stefan

Framerate
I have a movie at 24fps, but when I publish it, it seems to run much slower,(perhaps 12fps), is this normal, and can I change this ?

Max Framerate MX (mac/pc)
hello all.
Got an old-new question:
what is the maximum framerate that will play on all platforms? 15, 18?

The flash player 5 wouldn't play faster than 15 fps on macs.

any input?

thanks,
FF

Framerate
Haidiho!

Is it possible to use different framerates in a external swf. My level 0 swf has got a framerate of 20 and my level 1 has 60. But the player takes over the framerate of level 0!! Can I change that?

E.

Framerate?
How do you guys make a nice flash animation without it "lagging"? I tried making some, but it keeps lagging, thought may be because of my framerate (60fps), but if i drop it too low, it becomes ugly. ...

Framerate?
I have a big problem...I'm using an animated navigation that looks great using 50 fps. If I would do a site with this framerate..where are the problems? Someone knows if there are sites using higher framrates than the usual 12fps?
Another question is if there is a way to load movies with different framerates and keep them going on with them?

thanks a lot!

Swf Framerate Lag?
wondering if someone can help me. I've created an animated flash header for a website, and it just does fairly simple transistions from one image to another. For some reason the framerate seems to drop partway through the movie. The clip is set at 30 fps, exported at version 6 (was created in MX 2004).

Here's a link to the movie: header.swf

The clip begins to lag near the end of the first image transition..

Here's the .fla file if anyone is interested: header.fla

I have a slower PC, but i've been told by several people that the movie lags even on fast processors..

What Framerate To Use?
last time I made an animation I used the default framerate and some people told me that its better to use a higher framerate. What do you think is a good framerate to use, or what is the lowest framerate that shoudl be used?
Thanks, Matt

Which Framerate/s?
hello at all,

i´ve got some problems regarding to my flash site i´m creating.
for now i´m making the layout and some 3D animmations which i´ll put in this. my questions are:

1. how many fps do usually choose?
2. if i choose fps of 12 for my mainmc and then load another mc in it(my 3D mc),i.e. in level1 or a container, needs the movie at level1 also the fps of 12?
3. can there be different fps of the movies when they are in different levels?

thanks in advance for ur help.

best anfd greets

t

Framerate
I'm curious as to how frame rate plays into downloading a flash animation. Would it make the file much larger or harder to play on slower computers or because it's vector based would it not matter. And is there any standard as to what fps to use for flash animating? Thanks!

Framerate
Does anyone know of a way to have a certain framerate in one scene of a movie, and another framerate in the next? ie: Scene 1 FPS=30, Scene 2 FPS=50. Thanks in advance!

Framerate
is there a way to change the framerate of a movie via action script?

I have a power bar that moves up and down, but it moves too slow (but I need there to be that exact number of frames) so is there away to speed up the framerate when the powerbar starts moving but then put it back to normal when it stops?

Thanks!

Edit: I am using Flash 5

edit2: ack! sorry! I was too quick to post as this thread deals with this exact question http://board.flashkit.com/board/showthread.php?t=692273 mmods feel free to delete this thread (sorry for being a pain... again)

Different FrameRate
hi
how can i use a equalizer like this (http://www.flashkit.com/movies/Scrip...6641/index.php)
if my movies are 35fps ans the eqaulizer is 120 fps?
if i load the equalizer in the main swf it goes very very slow obviously.. how can i do?
thanks!

Different Framerate Within The Same *.fla
In my main file I have the standard framerate 12fps.

In a movieclip I have used this code;

Code:
function timelineFaster() {
nextFrame();
updateAfterEvent();
}
var tweenFaster:Number = setInterval(timelineFaster, 42);
on the first keyframe, and this make the movieclip
play faster in the main movie.

But when the movieclip comes to an end the movieclip-framerate
seems to transfer to the main movie, and the mainmovie speeds up.

What can I do to avoid it?

- helmer -

Framerate
Hi,

I have a fla that contains only a framerate componant that displays current / average framerate.

If I put the framerate up to 120,

The average framerate after 2 minutes is 34.

There is nothing else in the fla.

What is going on?

Thanks

FrameRate In AS3
Hello,

I know there is a method to control framerate in a movie using AS3. But is there any way to get the frameRate of an external SWF file that is loaded inside another using actionscript?

Any help would be highly appreciated

Get Framerate
Hi Folks,

Maybe you will find it useful - I know there has been several versions.


PHP Code:



Object.prototype.getFps = function() {    
    if (signal == true) {
        time = getTimer();
    } else {
        tempo = int(1000 / (getTimer() - time));
    }
    signal = !signal;
    return tempo;
};

// Aufruf
this.onEnterFrame = function() {    
    txtAusgabe = getFps();
}; 




yours
Matze K.

[FMX] Framerate MC
How do i change the framerate of a movieclip without changing the framerate of the main movie?

Tutorial or simple script examples are ok

[as2] Different Framerate Swf Flv
Do you know what happens when you put a 25 fps flv into a 30 fps swf?

Thx

Framerate
Okay, first of all, forgive me, for I know this question has probably been asked a thousand times before, but I didn't quite find the thing I wanted with the search button.

Anyways, I'm planning on creating a full flash website with lots of effects, so what Framerate should I use?

Thanks

Framerate
Is there any way to get the framerate of the current movie using AS?

[FMX] Framerate MC
How do i change the framerate of a movieclip without changing the framerate of the main movie?

Tutorial or simple script examples are ok

FrameRate
how do i change the framerate of a movie during the movie?

Framerate
What is best framerate to show flashpage and how big framerate I can put in my movie?

Getting The Framerate
hey,
As you know in flash if you are making games, if you have lots of graphical stuff the computer can get laggy. This is basically depending on the people's machine, how much RAM ect.

I wanna do it so that it's allways smooth, to do this I need to know what the current frame rate is. Then depending on the numbers I would do certain actions to reduce the graphics. But how do I get the FPS??

I don't mean the one I set, I mean when it is lagging horribly, is there a way to tell flash that it's lagging?

basically I need a statement that tells flash that if computer is lagging, turn variable on. Any ideas?

Recommended Framerate?
Looking at the Flash Sites of the day, I've noticed one big similarity among most of them: they seem to have graphics that move incredibly fast, yet very smoothly. Even http://www.2advanced.com moves relatively smoothly on my machine, which has a sucky video card.

What's the max framerate you guys would recommend?

Change Framerate Via AS - Possible Or Not?
is it possible to change the framerate of a swf via actionscript.

thx,
kay

Set Framerate At Runtime
Hello ppl,

anybody knows howto set framerate at runtime? Or maybe a tutorial which could help me out?


Thanx in advance!

Help Please Framerate Problem
http://www.interpaul.nl/schaapskooi/Movietest.html

can you please give me some info on how to make the framerate go up?

heres the deal. the site itsself is ok, but as soon as you press a button on the board another movieclip comes ontop of the whole site and shows a scroll that roll open.. thats where the problem is .. i has MASSIVE framerate drop on most of the pc's here. pIII800. thats bad!..

i think its all the text on the screen that causes the framedrops. its all behind a mask that opens up, as the scrolls openup, all motions are tweened, (yeah i know i should use scrpit, but its an update of an old site and i dont have the time to do a complete remake).

has someone got some ideas?

thanks in advance!
greets
Martijn.

Framerate Question
Hi All,

If i have a MC (MC1) at 24 fps and i stick it into a movie that is running at 12 fps (MC2)...will i still get 24 fps from the embedded MC in when i play MC2??

thanks all

Framerate Riddle
what is the best common FRAMERATE in order for a standard computer to visualize GOOD FLASH ANIMATIONS. computers like pentium II´s or pentium III´s. Im mean what... 10fps, 15fps, 20fps, 25fps, 30fps, 35fps? i dont know, please help me. Thanks in advanced guys.

Copyright © 2005-08 www.BigResource.com, All rights reserved