Detecting Frame Number?
Alright, I'm having a little issue...Currently, I have a navigation bar where when you roll over a button, a movieclip plays. On the roll out, the movie plays in reverse, making it appear to rescede to where it came from. If you roll out too quickly, it skips to the resceding part, and it makes it look like it skips.Is there any way to tell what frame a movieclip is on? If I can get that, I can write an If Then statement that would ensure it would wait till it got to the finished frame, and THEN do the rescedeing.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 04-21-2005, 07:19 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Detecting Frame Number?
Alright, I'm having a little issue...Currently, I have a navigation bar where when you roll over a button, a movieclip plays. On the roll out, the movie plays in reverse, making it appear to rescede to where it came from. If you roll out too quickly, it skips to the resceding part, and it makes it look like it skips.
Is there any way to tell what frame a movieclip is on? If I can get that, I can write an If Then statement that would ensure it would wait till it got to the finished frame, and THEN do the rescedeing.
Detecting Current Frame Number?
I have a movieclip placed in the main timeline. Inside that movieclip, there is another movieclip.
I need to know the current frame number of the inner movieclip when the animation is playing.
And report that current frame number back to the actionscript in the main timeline.
Anyone know how to achieve that? Thank you!
Detecting Frame Number On Stop Action
Is there a way to detect what frame number the timeline is on when a stop AS has been called?
example movie plays and stops at frame 11, i want to then capture that frame number and add it to a variable in a button
Detecting Frame Number And Loading External Movies
i am trying to load a movie by trying to traget a specific frame but to no avail. i read some time ago here on the board that you could use the _currentframe property to do this sort of thing and its doing my head in !!
here's the specifics
i have 2 movie clips called 'pic1' and 'imagebox'
'pic1' acts as a thumbnail with an image inside, and an empty button in it which when you click on it prompts a box to open (imagebox), and then once that is fully open it loads the larger version (as an external swf file) of the image so as to minimise download time.
the actionscripting i've used is as follws:
Button inside pic1:
on (release) {
with (_root.imagebox) {
gotoAndPlay (2);
}
if (_root.imagebox._currentframe==25) {
loadMovie ("externalmov.swf", "externalmov");
}
}
'Imagebox' has a tween inside it which makes the box bigger to accommodate the larger image, with a stop action on frame 1 and on frame 25. Inside this mc is an empty mc called 'externalmov' which acts as a target for the external swf file to load into.
try as i may the _currentframe property does not seem to work. all i want it to do is the following:
if it is at such a frame please please please load external moviw externalmov.swf
is there another way of doing this??am i no where near?
thanx for you help!
Detecting If A Var Is An Odd Number?
Hi,
I need to check whether a varaible is an odd number, as I alternate which part of the movie I play.
something like....
if(i=oddNumb)
{
gotoAndPlay(...)
}
else
{
gotoAndPlay(...)
}
I was thinking if i could take the value of the variable divide it by 2, and then check whether the answer is a decimal and then I could tell if it was an odd number., But Im not sure how to do this, ive checked the AS dictionary and a searched the forums.
Your help greaty appreciated
Detecting If Number Is Odd Or Even
I thought I had a nice way to do this, but it's not always accurate for some reason. I was using (where myNumber is a number):
evenOrOdd = myNumber % 4; // 4 or any number
if (evenOrOdd == 0) {
// Number is even
}
Is there another way?
Detecting If Number Is Odd Or Even
I thought I had a nice way to do this, but it's not always accurate for some reason. I was using (where myNumber is a number):
evenOrOdd = myNumber % 4; // 4 or any number
if (evenOrOdd == 0) {
// Number is even
}
Is there another way?
Detecting Number Of Files In A Dir With AS
Hi all. Is there a way to make flash detect how many files are in a particular directory, and then use that number to define the range of a random number?
I've made a slideshow for a friend that loads random images, but I've had to specify the range manually. It's for his dad, and I want for him to be able to just plonk new images in whenever he likes and it will just work.
I'm using MX 2004.
Any help greatly appreciated, cheers!
Shared Object To Store A Unique Id Number Var And Frame Number Var
Hi, I am a complete novice to action script when it comes to objects. I know what I want to do is done with the shared object. Basically I want to create a tutorial that stores a cookie on the users’ machine with a unique id variable telling flash what frame the user was at last. When the user revisits it would prompt "continue where left off or start the tutorial over. I read the action script dictionary regarding the shared object, but being a designer I really need to visualize it before I can comprehend this.
Thanks,
Justin
Detecting And Removing Number From String
I am trying to figure out a way to detect and remove a number from a string. The value of the string is entered from a input text field. I need to detect leading zeros and remove them from the string. I understand the logic but familiar enough with the AS syntax yet.
//Found this to detect the first digit in the string
check = myString .charAt( 0 )
Need help forming the if statement to detect if leading digit is '0' and if = 0 remove it from string.
Thanks for any help you might be able to provide....
Input Text - Detecting ODD Number.
Hi people,
I've got a few input text fields and a submit button on an order form I've designed. Trouble is you can only order in multiples of 2. Naturally I have a warning stating that orders must be multiples of that number but there is always room for idiocy!
Lets say my order input text box is called "order" and the button used to proceed to payment is called "submit". How do I detect an ODD number entry and have it run an mc called "warning"?
Does that make sense to anyone because I'm confusing even myself - which admittedly isn't hard for me today.
Thanks.
Detecting Number Of Attributes In ChildNode
Hi there everyone,
im trying to write a handfull of XML functions in AS2.0
and im trying to find a way of getting flash to detect
the number of attributes in a childNode.
<item name="aaron" location="sydney" sex="male"/>
as in finding out how many of these ^ there are in each item.
any ideas as to how I would do this? I've tried for...in... statements
and even trying to access them as objects i.e. ...ode[0].attributes["name"]
but it never works - I always have to hard code...ode[0].attributes.name
to get the value.
im sure theres a way to do this, there has to be a way.
please show me the way
Thanks in advance !!!
Input Text - Detecting ODD Number.
Hi people,
I've got a few input text fields and a submit button on an order form I've designed. Trouble is you can only order in multiples of 2. Naturally I have a warning stating that orders must be multiples of that number but there is always room for idiocy!
Lets say my order input text box is called "order" and the button used to proceed to payment is called "submit". How do I detect an ODD number entry and have it run an mc called "warning"?
Does that make sense to anyone because I'm confusing even myself - which admittedly isn't hard for me today.
Thanks.
Detecting Number Of Attributes In ChildNode
Hi there everyone,
im trying to write a handfull of XML functions in AS2.0
and im trying to find a way of getting flash to detect
the number of attributes in a childNode.
<item name="aaron" location="sydney" sex="male"/>
as in finding out how many of these ^ there are in each item.
any ideas as to how I would do this? I've tried for...in... statements
and even trying to access them as objects i.e. ...ode[0].attributes["name"]
but it never works - I always have to hard code...ode[0].attributes.name
to get the value.
im sure theres a way to do this, there has to be a way.
please show me the way
Thanks in advance !!!
Detecting A Character And Number In Input Text
I'm working on a delivery costing system for my company using postcode input from users and I've got an idea I needs some help with...
For you non Brits out there UK postcodes work on two blocks of 2-4 characters each.
L2 2HH - Liverpool central
M24 2TN - suburb of Manchester
IV56 7NQ - outter Inverness
You get the idea. So the first part of a UK postcode, wether it be 2 characters or 4 characters MUST have atleast one numeric and one non-numeric character in it. How do I detect this?
At the moment I've just got my CHECK POSTCODE button to run a few functions only if my POSTCODE (input text) field length it greater or equal to 2 characters. So how do I easily detect an input of numeric and non-numerical characters without having to resort to indexOf ...a...b...c...1...2...3...?
Detecting A Character And Number In Input Text
I'm working on a delivery costing system for my company using postcode input from users and I've got an idea I needs some help with...
For you non Brits out there UK postcodes work on two blocks of 2-4 characters each.
L2 2HH - Liverpool central
M24 2TN - suburb of Manchester
IV56 7NQ - outter Inverness
You get the idea. So the first part of a UK postcode, wether it be 2 characters or 4 characters MUST have atleast one numeric and one non-numeric character in it. How do I detect this?
At the moment I've just got my CHECK POSTCODE button to run a few functions only if my POSTCODE (input text) field length it greater or equal to 2 characters. So how do I easily detect an input of numeric and non-numerical characters without having to resort to indexOf ...a...b...c...1...2...3...?
Variable Number = Frame Number#$%@&*
I have a movie Clip called “percentage bar” and a variable text box called “percentage”.
Now I get a number from VB and this number is = to the value of ”percentage” (my variable txt box).
The Movie Clip has a 100 frames… here it comes I need to have whatever the variable number (“percentage”) is to determine which frame the movie clip (“percentage bar”) is standing on.
This has to be possible, don’t it?
Variable Number = Frame Number ?
Here's an easy one for anyone who knows actionscript...
I have a variable text box called "percentage" and a movieClip called "progressbar" (100 frames).
I want the number in my variable txt box "percentage" to tell "progressbar" to go to the corresponding frame number.
for instance if the number in the txt box is 15 the movieclip has to go to frame 15.
Thanks
- a Designer, forced to be a programmer.
Can't Target A Frame Label Or Frame Number Within Movie Clip
Hi guys,
Can't for the life of me figure out why this is not working:
if (_currentframe==82) {
homefade_mc.gotoAndPlay("fadeup");
design_mc.gotoAndPlay("design_fade"); - this one is fine
}
- the first gotoAndPlay should be going to the homefade mc and then going to the "fadeup" frame label and play from that, but instead it does nothing. Any clues?
Chris
IfFrameloaded() Depreciated How To Get Frame Number From Frame Label
ifFrameLoaded() has been depreciated in Flash 5, leaving me with using _framesLoaded which gives me no way to verify a frame label is loaded as far as I can tell.
I thought there was a way to get a frame number from a frame label but I can't find it. How would you determine if a frame label is loaded (not the whole movie, but the just up to the frame label).
The reason I have to do this is that I have large animations that are changing a lot during production and thus the frame numbers are changing. I need to determine if a frame label is loaded (not the entire movie).
Thanks for the help!
How To Obtain Frame Number From Frame Label?
Hi Guys
Does anyone know how I can find out what the frame number is of frame which has a label at runtime using actionscript?
I don't think I can use _currentFrame as I need to find out the frame number prior to actually moving the player head to that location.
for example:
say you want to goto a frame labelled "bananas"
How can I find out what the frame number is of the bananas frame?
Cheers!
Finding Frame Number Of Frame Label With AS
is it possible to find the frame number of frame label with AS
what I am trying to do is ...
if a button is rolled over, the timeline jumps to a label - which plays a set of 3D rendered frames to 'raise' and element, once a user rolls out of the 'button' area the button is meant to 'lower' - which can be done by simply playing backwards to the previous label.
any clues?
cheers actionscript heads!
Paul
How To Obtain Frame Number From Frame Label?
Hi Guys
Does anyone know how I can find out what the frame number is of frame which has a label at runtime using actionscript?
I don't think I can use _currentFrame as I need to find out the frame number prior to actually moving the player head to that location.
for example:
say you want to goto a frame labelled "bananas"
How can I find out what the frame number is of the bananas frame?
Cheers!
If Else? Detecting Which Frame An MC Is On
Is there a way when a button is clicked to check if a movie clip is on a certain frame, if it is leave it there, if not tell it to gotoandplay? I was thinking its an if else kind of statement but I'm not sure how to write it out.
Detecting A Frame In Swf
I am loading a swf which has 8 frames into a Sprite and the that Sprite into "myClip". How do I detect when my swf has reached frame 8 from "myClip".
Detecting Which Frame
hi im trying to make a button (movie clip) that if its on the fram "play" when it rolls over it will go to "playover" and if the button is on fram "pause" it goes to "pause over"
this is my attempt which doesnt work
Code:
playbutton.onRollOver = function()
{
if(this.gotoAndStop("play") == true)
{
this.gotoAndStop("playover");
}
else
{
this.gotoAndStop("muteover");
}
};
i think the problem is on the this.gotoAndStop("play") == true) how do you detect which frame the movie clip is on
Detecting A Frame Through Its Label
I have include some code in a movieClip to check if the frame it is within matches a label. The code is similar to below:
if (_currentframe == "repeat")
{
do something;
}
However, I realized that _currentframe always returns the numeric frame value. Is there a simple way to check to see if you are in a frame with a certain label? Is there a function or property that I can not find? Is this possible without using a variable and checking that?
Detecting Current Frame
I am trying detect if a movie clip is on specific frame label and if so, move to another on release on a button and move to the movie clip that is associated. The code I'm using below does not seem to be working. Anybody have an idea?
on (release) {
if (_root.page01._currentframe == "stop") {
_root.page01.gotoAndPlay("fadeout");
} else if (_root.page02._currentframe == "stop") {
_root.page02.gotoAndPlay("fadeout");
} else if (_root.page03._currentframe == "stop") {
_root.page03.gotoAndPlay("fadeout");
}
}
}
on (release) {
_root.page02.gotoAndPlay("fadein");
}
Detecting Frame Has Loaded
is it possible using _framesloaded to detect that a framelabel has loaded as opposed to finding what the frame number is on the main timeline eg. the particular frame may not stay in it's current position.
the frame ("frameAboutUs") i would like to know that is loaded is at the start of a new scene ("about us").
should i be setting a frameLoaded = false variable at the start of my movie instead??
Detecting When You Leave A Frame
How can i detect when a particular frame is left? i.e. The user is viewing fram x, they click one of several buttons or perform a particular action which causes the swf to move to a different frame how can i detect when it exits the original frame x?
Flash Detecting URL In Frame?
Hi,
Can Flash MX detect what url a frame has loaded ? e.g.
If an i-frame on my webpage = home.html then the flash movie will go to frame "home" (within the movie) else "stop" (on same frame in the movie.
Does any body know if this is possible?
Thanks in advance, Chris
Detecting If Mouse Is Outside Frame
Is there anyway to detect if the mouse is outside the stage area?
I have been using the _xmouse and _ymouse coordinates to do this, but have noticed that if you move the mouse too fast it doesn't detect that its moved outside the stage area.
Flash Detecting URL In Frame?
Hi,
Can Flash MX detect what url a frame has loaded ? e.g.
If an i-frame on my webpage = home.html then the flash movie will go to frame "home" (within the movie) else "stop" (on same frame in the movie.
Does any body know if this is possible?
Thanks in advance, Chris
Detecting If Mouse Is Outside Frame
Is there anyway to detect if the mouse is outside the stage area?
I have been using the _xmouse and _ymouse coordinates to do this, but have noticed that if you move the mouse too fast it doesn't detect that its moved outside the stage area.
Detecting The Frame Label
Since there is no function to detect the frame label, I'm assigning a value to the variable that changes in labeled frames...
It's simple and should work... BUT...
Take this simple example: Create a moviclip on the _root, name it "a".
create 2 keyframes in it. Put this code is first one:
label = 1; stop();
and this is second one:
label = 2; stop();
now, in the root add that code:
_root.a.gotoAndStop(1);
trace(_root.a.label);
_root.a.gotoAndStop(2);
trace(_root.a.label);
stop();
better add that code to keyframe 2, to make sure the "a" moviclip loaded in the 1st frame...
Guest what will be the result on the screen?
"1 2 "? Nope... It's "1 1"!!!... And it's not because the "a" moviclip has empty keyframes (try adding any graphics)... Looks like it just does't change the "label" variable... It jumps over the frame... Any ideas?...
Detecting The Current Frame Lable
I doubt there's a way to do this but just to be thorough....
Is there a way that AS code can detect the current lable's name?
So that, if while authoring my movie, I name a keyframe 'Start' and I drop a symbol within it ... code _in that symbol could detect that it (the symbol) exists in that frame lable.
thankx
--steve...
Detecting What Frame Is Flash In A Level
Hi, see, this is my problem
I have a swf movie in level 4, and one in level 3,
The level 4 is a music box that show when you like a button, and minimize the music box when you click the minimize button of the music box.
The complete movie is in level 3, what I want to do, is that, when you change scene on level 3, -in the first frame of the scene- it detect if the music box (level 4) is in the frame labeled "minthis", and if it's in "minthis" then go to and play frame "minimize" in level 4.
Can anybody help?
Frame Label, Instead Of Frame Number
gotoAndStop (random(5)+11);
The above actionscript means to go to frame11,12,13,14,15
randomly and stop.
I want to use frame label as the starting point of the random frame because frame number11 is easily changable.
For example, after I put a frame label "ABC",
I have tried the next scripts. However, they don't work.
gotoAndStop (random(5)+"ABC");
gotoAndStop ("random(5)+ABC");
Would you help me? please.
Thanks in Advance
Get Frame Number From A Frame Label?
I thought I saw a way to get a frame number value from a frame label but now I can't find it anywhere. Could be I'm thinking of Director Lingo.
Is there a way to get the frame number for a frame label?
Thanks!
Frame Label Vs. Frame Number
if i have a button with the following action, page01 being the frame label, my button does nothing.
on (release) {
gotoAndPlay(page01);
}
if i have this action, 24 being the frame number for page01, it works.
on (release) {
gotoAndPlay(24);
}
i'd rather not use the frame numbers. do i have the syntax wrong for the labels?
thanks!
|