Adjusting A Script To Nr Of Frames?

Aug 19, 2009

Basically this is it: I have a movieclip with four frames with this script on it:

Code:

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
if (_currentframe != 1) {
gotoAndStop(2);

[code]....

Basically this is how i want it to work: If you're at frame 1 (which you start in since a layer above have a stop on it) and press and hold left you go to frame 2 and if you stop holding down left it goes back to frame 1. If you're on frame 1 or 2 and press and hold right you go to frame 4 but if you stop holding right it goes to frame 3

View 1 Replies


Similar Posts:


Possibl By Way Of Adjusting FPS Maybe?

Nov 20, 2009

I have a movieclip and what i'd like to do is once a button is clicked id like the clip to play a double speed (or maybe more).Is it possible, by way of adjusting the FPS maybe?

View 1 Replies

ActionScript 2.0 :: Adjusting MCs Hue Filter?

Jun 22, 2007

I was wondering if there is a simple way to control the "Adjust Color: hue" - filter of a MovieClip?. Is it possible to adjust it with a single variable(with AS2)?

View 5 Replies

ActionScript 1/2 :: Adjusting Volume With SoundChannel?

Sep 3, 2007

AS2 -> AS3 migration: doncha just love it?!have a look at the attached code. selection one makes us anew sound and gets it playting, great. then we need to adjust thevolume so we read in the files that:You can alter the volume and panning while a sound is playingby setting the pan or volume properties of a SoundTransform objectand then applying that object as the soundTransform property of aSoundChannel object.great, so selection 2 in code below should do that, right?

View 7 Replies

Javascript :: Self Adjusting Random List?

Jan 5, 2012

I have a grid of 9 columns by 3 rows (so each column has 3 slots). A minimum of one slot in every column must be marked and no more than 3 can be marked. A mark is represented by a 1,2 or 3 digit.There must always be 15 marked slots in total. To achieve this I tried the following:

var valueLeft = 15;
while (valueLeft > 0)
{

[code].....

View 3 Replies

ActionScript 2.0 :: Adjusting A PreLoader Code?

Oct 7, 2009

How can i get adjust this preloader code so it loads my main site from an external swf.

preloader.swf -loads index.swf
loaded = false; mytimer = 0; onEnterFrame = function () { loading = Math.round(_root.getBytesLoaded().toString()/1024); total = Math.round(_root.getBytesTotal().toString()/1024); precentage = Math.round((loading/total)100); myprogress = loading/total };

[code]....

View 1 Replies

ActionScript 2.0 :: Adjusting The Width Of A Mc Without It Stretching?

Nov 25, 2009

I have a container movieclip and i am attaching thumbnail images to it to form a slideshow.

The problem i have is i need the container to scale to the stage width, and then add the images, but if i scale the container it also stretches the attached images.

Is there anyway i can change the width of the container without effecting the attached images?

View 0 Replies

ActionScript 2.0 :: Link Adjusting Re-arrange Themselves

Dec 19, 2009

How would you make links re-arrange themselves the ones on this site.[URL]

View 0 Replies

ActionScript 2.0 :: Adjusting Volume In External FLV?

Apr 30, 2010

I'm looking for a way to adjust the volume in an external flv. The code below sets the volume, is there any way to have it start at one volume and fade to "0" over the length of the flv?

this.createEmptyMovieClip('snd', 0);
this.snd.attachAudio(this.ns); //attach NetStream
this.audio = new Sound(this.snd); //Set MC as source
this.audio.setVolume(80);

I also tried start/stop buttons, but they start and stop the flv also, any way to set them up so the flv keeps playing without the sound?

View 1 Replies

ActionScript 2.0 :: Adjusting Variables In OnEnterFrame?

Jul 21, 2010

I have this function inside a this.onEnterFrame function. What I need it to do is that every time I hit Q, the variable (_dropAdjust) should decrease by 1, and every time I hit A, it should increase by 1.

What it is doing, is that every time I hit either of the buttons, the variable decreases or increases by a increment dependent of the time that has passed, but I still need to have the function inside the onEnterFrame, because if not I can only hit the button once.

ActionScript Code:
this.onEnterFrame = function () {
var _adjustListener:Object = new Object();

[code]....

View 1 Replies

ActionScript 3.0 :: Adjusting Vanishing Point?

Nov 20, 2010

one of my homework assignments for a begginer Actionscript/flash class. The goal of the assignment is to draw a shape then have it continuously drawn until it reaches the vanishing point in the center of the stage. I am pretty new to actionscript since this is the first class I have taken for it and I really dont know how to explain it better. I am trying to write the code for. This is the code I have so far it basically just draws the shape I am using and I am lost on what to do next:

Code:
package {
import flash.display.Sprite;
import flash.events.Event;[code].....

View 0 Replies

Actionscript 3.0 :: Simple XML Adjusting For MP3 List

Jan 28, 2010

I am new to XML and I have tweaked a mp3 player from a [URL] file to do exactly what I need it to except for one small thing.... I need for each song to be able to load different album artwork independently, right now the jpeg is assigned to all the songs in the playlist. I did the tutorial and while it made sense. this "final" example goes far beyond the scope of the tutorial (he leaves it as an example of what could be done if you know what you are doing (I don't))

[Code]...

View 4 Replies

ActionScript 2.0 :: Adjusting The Width Of A Movieclip

Oct 13, 2003

I need to read two image locations from a file and join it together. For this i used the following code.

[Code]....

With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.

View 2 Replies

ActionScript 2.0 :: Adjusting Scroll Bar By Claudio?

Jul 22, 2006

Does anyone know how I can adjust the speed of Cladio's scroll bar so when the arrows are clicked the scroll runs faster? Attached is Claudio's original file if needed. The speed variable has no effect on this? I tried adjusting the interval property of both the (up_btn and down_btn) to a lower number from "18" to "0" Like so...

[Code]...

This seemed to work when previewed in the player but once uploaded for some reason the scroll slowed down again? something to do with the frame rate? movie is set up at 30fps. Also, the content being scrolled is dynamically loaded via XML... Would this have anything to do with the lag?

View 3 Replies

ActionScript 2.0 :: Adjusting Frame Number ?

May 31, 2010

I have a timeline slider part to my animation which starts at frame 1089 and ends at frame 1173, I have a script which allows me to do this and works perfectly when I build it in a new flash file starting at frame 1, I need this code to work for the animation I have built at frame 1089, I dont know which number "1's" in the script relate to the frame number, I have tried changing them all to 1089 but that doesn't work! at the moment as soon as I click on this it jumps back to frame number 1 - which I believe as the code stands is exactly what it should be doing. Please could anyone edit this code so that it realises which frames I want it to work in?

var numOfFrames:Number = 85; // number of frames in the timeline to scrub
var widthOfScrubber:Number = 500; // width in pixels of scrubber bar
var widthOfScrubberSlider:Number = 25; // width in pixels of scrubber slider[code].....

View 3 Replies

ActionScript 2.0 :: Adjusting The Width Of A Movieclip?

Oct 13, 2003

I need to read two image locations from a file and join it together.For this i used the following code.

Part A:

//this reads from the file images.txt and puts in an array "images"
//the size of the array "images" is 2
//
m = new LoadVars();
m.onLoad = function(ok) {[code]...........

With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.

View 2 Replies

ActionScript 2.0 :: Adjusting A Mc's Height With A Slider?

Dec 5, 2003

I have a sound loop that plays perfectly and I have a volume slider that works great. Here's my problem, I need to control a seperate movie clip -an animation- with that same slider (the volume controller).. It needs to adjust the height of this mc up and down... like when the volume goes down, the height of the seperate mc gets smaller and vise/versa..

this seems like a fairly straightforward thing to accomplish, but like I said I'm not all that great at AS...

View 10 Replies

ActionScript 2.0 :: Adjusting Volumes With Multiple Sounds?

Apr 27, 2009

m using Flash 8. And I'm trying to adjust two sounds files using action script. First I set a sound file to 100, then I tried to set another file to 25 but when that happens, it also sets the first sound file to 25.

How do I adjust the second sound file so that the first one doesn't get changed as well.

By the way, here's the action script I was using for both sound files:

Sound File 1
background = new Sound();
background.attachSound("Kingdom Hearts Theme");
background.setVolume(100);

[Code].....

View 2 Replies

ActionScript 2.0 :: Adjusting Line _width With Changes _height Too?

Nov 19, 2009

I have a horizontal line that is in a movie clip. To adjust the width of the line when I click a button I use

Code:
btn.onPress = function(){
line._width += 20;
}

This does change the width, but the line gets thicker (height is increasing) as the width increases. Why is this happening, and how can I keep it from happening? I want only the length of the line to change, not its thickness.

View 1 Replies

ActionScript 2.0 :: Images Adjusting According To Window Size?

Dec 8, 2009

I saw this website CLICK HERE TO SEE WEBSITEand I've been trying to create the same effect where if you resize the browser window the main image on the gallery adjusts to the size of the window but the rest of the flash stays the same.

View 8 Replies

ActionScript 2.0 :: Adjusting Frame Number In Script?

May 31, 2010

I have a timeline slider part to my animation which starts at frame 1089 and ends at frame 1173, I have a script which allows me to do this and works perfectly when I build it in a new flash file starting at frame 1, I need this code to work for the animation I have built at frame 1089, I dont know which number "1's" in the script relate to the frame number, I have tried changing them all to 1089 but that doesn't work! at the moment as soon as I click on this it jumps back to frame number 1 - which I believe as the code stands is exactly what it should be doing. Please could anyone edit this code so that it realises which frames I want it to work in?

var numOfFrames:Number = 85; // number of frames in the timeline to scrub
var widthOfScrubber:Number = 500; // width in pixels of scrubber bar
var widthOfScrubberSlider:Number = 25; // width in pixels of scrubber slider

[code].....

View 1 Replies

ActionScript 3.0 :: Adjusting A Movie Clips Brightness?

May 6, 2009

Can someone share their method for adjusting the brightness of a Movie Clip?

View 3 Replies

Adjusting Flash Stage Size To Webbrowser?

Jul 8, 2009

In my site I want to make my flash site extends or shrink according to the webbrowser size. This way my flash would always be on "fullwebbrowser size".Of course I would like a minimum size too.

View 6 Replies

ActionScript 1/2 :: Adjusting Code Which Allows Button Activation?

Mar 24, 2009

I have inherited some code which is a matrix of buttons which give a score of 1-7 depending on which button is pressed. The matrix consist of 6 rows and 7 buttons and once all rows have a button pressed the final score is calculated and a submit button becomes activated (it is de-active until all rows have a score). This works fine, but I have added a function in which you can press a button which de-activates one row and activated another, so there are now 8 rows instead of 7, even though I want the total score to still calculate when there are 7 scores to tally up the total. The code I have now works with the first 7 scores, but when you add the 8th row it won't tally up the score, and activate the submit button. I am attaching the code I currently have to do this.

View 1 Replies

ActionScript 3.0 :: Make Speed Adjusting Buttons?

Oct 18, 2011

I just made a small application with some timeline animations.But people need to be able to set a speed for how fast it plays.So how do I make a button, that they can click and then for example it al goed at half the speed.

View 1 Replies

Flex :: ViewStack - Adjusting Component Size To Be Same

Mar 22, 2010

I have a viewstack with 3 items in it. Now my problem is that I want all these components to be of the same size. Its simply enough to do this manually but is there any other way of setting the size for all the components at once?

View 2 Replies

Flash :: Adjusting 4 Scroller Height To Content

Aug 26, 2010

I am having a little difficulty properly sizing a Scroller component in Adobe Flex/Flash 4. As soon as I add an element to the 'widgetsGroup' VGroup, the scroller's height property resizes to match that of its parent border container, even though the content height of the vGroup may be significantly less than this value. This is a problem because the scroller then 'covers' other elements in the border container. I guess what I am looking for is the scroller height to match the widgetGroup content height until this height exceeds the bordercontainer height, at which point the scroll bar would become visible.

[Code]...

View 1 Replies

ActionScript 2.0 :: Adjusting Start Page In Pageflip

Sep 30, 2009

I'm trying to get it to start and end on a spread rather than with a front cover and back cover (with blank space on the left and right). I just need to flip between two spreads.I have gotten it to start on page2, but it appears on the right rather than on the left as a spread. I tried getting rid of ename="blankpage"; on line 123 and 127, but it only caused order issues.

View 0 Replies

ActionScript 3.0 :: Adjusting The Height Of The Slider Component

Jun 4, 2010

Why can't I adjust the height of the slider component? I created a new component and placed it on the stage, and changed the height of all of the images that comprised this slider (which were movieclips) to a larger size, but it still remains a skinny line when I run the program. I even did this in the Actions section:

mySlider.height = 20; but it seems like the program is ignoring anything that has to do with adjusting the height of the slider. If I try adjusting the width, however, then that works. It makes the line longer when I set the width a larger number. But why is the height of the slider line not being adjusted? No matter what I do, nothing is working. I have searched all over the internet for answers, but I can't find anything.

View 0 Replies

ActionScript 3.0 :: Two Sprite Objects - Adjusting Position (X And Y)

Jan 23, 2012

I am trying to do adjustment of position (x and y) of display objects, relative to other display objects. In other words: I have two Sprite objects (rectangle and circle). The rectangle can have their width changed during execution. Yet the circle has a fixed size. What I do is this: regardless of the width of the rectangle, the circle is positioned at the far right of this rectangle.

I tried as follows:
ActionScript Code:
rectangle.width = someValue;
circle.x = rectangle.x + (rectangle.width-circle.width);

In theory it should work, but look what happens:
imageshack.us/photo/my-images/837/positionq.png

As the width of the rectangle increases the distance from the desired location also increases.
Using:
ActionScript Code:
trace (rectangle.width);

I realized that the value of property 'width' does not match the exact amount of pixels that the object is wide. I just did a test and realized that this problem only happens when the rectangle has edge. When the rectangle has only fill, this problem does not occur.

View 9 Replies







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