ActionScript 3.0 :: Toggling Repeat On And Off?

Feb 26, 2010

I got some code to make a  video loop indefinitely with the nsvid4_loop function, but i want it t  be toggleable via a button I am trying to set up a function to do that (vid4loopwitch).. i'm getting stuck though on how exactly to incorporate the one nsvid4loop with its event listener into the function for repeating  it is probably pretty straightforward i'm just still learning my way around AS. check the code to see what i have so far.. i just need to know what i need to add  to the vid4loopswitch function to get it going. it is really hurtin my brain

var nsvid4:NetStream = new NetStream(nc);
nsvid4.client = this;
nsvid4.play("clips/video1.flv");

[code].....

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Toggling Between On And Off Between Clicks?

Jul 14, 2011

how to do it but i'm not sure how to implement. I basically have one button that when i click with need to trigger a function. When I click it again it will trigger a second function and will keep this up back and forth.

View 3 Replies

ActionScript 3.0 :: Toggling A Layer's Visibility?

Dec 26, 2008

I've got several layers in the timeline and I'd like to know the most effecient method to toggle the visibility of any one of the layers when a user clicks a button I have on the form.

The layers are all simply graphics that have been imported and the only functino they have on the time line is that they each come in at different times during the playback of the movie. I'd like to have the ability to toggle the individual layer when a user clicks the button.

View 3 Replies

ActionScript 1/2 :: Toggling Between Two Button Symbols

May 5, 2009

I am new to AS, but not new to programming.I'm using Flash CS4.I have two button symbols, PlayBTN and PauseBTN. They are used to control the playback of a slideshow. When I use either one or the other to control the slideshow, it works. However, what I want to do is toggle between the two buttons, so that they work together like this:

1. If the slideshow is playing, PauseBTN is visible. If PauseBTN is clicked, the slideshow stops, and PlayBTN becomes visible.

2. If the slideshow is paused, PlayBTN is visible. If PlayBTN is clicked, the slideshow stops, and PauseBTN becomes visible.

In other words, clicking the button not only controls the slideshow, but changes which button is visible.I had this working using a two-frame movie clip and static bitmaps, but when I swap out the bitmaps for the buttons, the button rollovers stop working.

View 8 Replies

Actionscript 3 :: On Toggling Button Flex

Aug 25, 2011

I have a button in action script with toggle="true". Now when I click the button its color changes and it looks as if it has been disabled (but its actually not). I need to know which property of this button has changed? For example if I need to know somewhere in my code the "toggled state" (if there is any such thing) of this button, which property of this button should I check?

View 1 Replies

ActionScript 3.0 :: Toggling Visibility On Multiple Elements?

Dec 6, 2010

I'm working on a project that has multiple movie clips and I want to have three buttons, you press button1 and it displays mc1, then you press button2 and it displays mc2 and also hides mc1. same with others so if mc1 is on and you press button3 it will turn mc1 off and turn mc3 on. so any combination only turns on its respective mc.

how to do this without an extraneous amount of code. It will eventually have over 20 buttons, so I want to keep code clean if possible.

View 4 Replies

ActionScript 3.0 :: Toggling Buttons With Separate Actions?

Feb 11, 2011

I have 4 buttons on the stage and each button is correlated to a seperate movieclip.
 
btn1 - mc1
btn2 - mc2
btn3 - mc3
btn4 - mc4
 
I want each mc to appear when it's corresponding btn is clicked but it has to be the only mc on the stage...meaning whatever mc was currently has to disappear. I've toyed with numerous was to get this to work but I know there's a more code efficient way to do this than the code I have below. And I don't want to use any timeline.

[Code]....

View 3 Replies

ActionScript 1/2 :: Pause And Play Toggling Button?

Mar 23, 2011

I have created a Pause and Play button that toggles between states.  It controls a Timeline with synced Sound.  When I use it the sound and animation go out of sync.  Can anyone help me with this or perhaps have better code I could swap out to make this work?
 
Below is what I am currently using:On the first frame of an Action Script layer put this AS:
 
playBtn.onRelease = function() {
ns.pause(false);
playBtn._visible = false;
pauseBtn._visible = true;

[code]....
 
Put the Pause and Play buttons directly over each other on 2 layers for the duration of the timeline.Pause Button on top. (unless you have a STOP on the first line then maybe the Play button will start it.

View 3 Replies

ActionScript 2.0 :: Multiple Button Toggling Thoughts?

Oct 7, 2009

How do you deal with toggling multiple buttons? When one button clicks on the previous active button(s) turns off.

What is the standard practice for dealing with this? Have listeners on all the buttons checking if their name is in an activeButton variable (which seems process intensive with all those listeners going)

A FOR loop to go through all the buttons states and check the activeButton variable when any button is clicked?

That is two ways I have done it but I think there has to be other ways that might be more elegant.

View 3 Replies

ActionScript 2.0 :: Complex Toggling Visibility Of Movieclips With Other Clips

Jan 24, 2009

I have a question, but it needs a little backstory and explanation to make sense. I've searched a lot of places for an answer and have only come up short.I'm using Flash 8 and AS2.A few months ago I made a somewhat complex interactive doll.I came up with the idea to have the blouse have these massively poofy sleeves, and then have a jacket be tight fitting. So when I move the movieclip of the jacket over onto the blouse, the sleeves will disappear, kind of like real clothing, where you can bunch up fabric to fit.I did this by cutting the shirt into three separate movieclips and coding them to move together, so when the jacket moved onto the specified coordinates, and the shirt was established on the base, the sleeves movie clip would simply disappear.

Below is part of the action script connected to the jacket.[code]When you move the jacket away, the sleeves are still invisible. And if you have the shirt and jacket on, and you click on the underwear button to view the undergarment movieclips, the sleeves and sides are visible again, simply because that is the coding for the "drawer" buttons. Simply clicking on the jacket or the shirt creates the desired result, but it doesn't look very clean.I've tried using similar script to the above, to make the visibility true, but it's only served to make it visible all the time, even if the drawer buttons make it invisible.[code]

Is there a script I can use so the sleeves disappear once the jacket is on, but immediately after moving the jacket away, the sleeves reappear? And at this point, is there a way to keep the "undress" button from affecting this, but still keep the sleeves invisible when it reveals other garments and the shirt is on the doll?Should I be making the sleeveless shirt another frame inside the shirt movieclip, rather than a completely separate movieclip? And if so, I know how to go and stop to the next frame using a button, but not sure how to do it with a movieclip.So, I still couldn't get it to work with the shirt as 3 separate movieclips. Instead, I made it all one movieclip with different keyframes, each combination possible on its own frame. And when the jacket moves onto the shirt, it goes and stops to frame 2. When the jacket is not on the x coordinate, it goes and stops to frame 1 again.

View 2 Replies

ActionScript 3.0 :: Sprite Button Not Toggling Sound Volume?

Jul 21, 2010

This is a completely AS3 scripted, and dynamic project, meaning I cant use any assets from the library.

1 - This button is a mute. � Currently the loaded sound now fades in with a timer.� I want the button to over-ride any sound elements on the stage: the mp3 and later a flv movie as well.� In the below example the button only interferes with fade, and dosen't actually override it, after the fade - it dont do jack. � SoundMixer.stopAll(); will of course kill everything but I cant toggle this(can I?)


2 - The toggle button itself � I've loaded two png's into a sprite, and created a toggle button from them using an if statement. � Is this best practice? or would you recommend something else?� Perhaps SimpleButton?

ActionScript Code:
var btmUpURL:String = "a_icn-1.png";
var btnDwnURL:String = "a_icn-0.png";
var btnLoader1:Loader = new Loader();
var btnLoader0:Loader = new Loader();

[code].....

View 9 Replies

ActionScript 3.0 :: Toggling Video Fullscreen And Positioning Videoplayer UI?

Oct 12, 2011

I've landed a project which is centered around building a custom video player with some special functionality (so I can't just use the default Flash video player, unfortunately). I have two small 'problems' in the sense that I could probably solve them myself, but I'd like some input on best practice for solving them:(The project is for Flash Player 10 and the video is intended to run inside a browser.)

Toggling between normal / fullscreen playback Ok, so my custom video player needs to be able to toggle between fullscreen and normal embedded-in-webpage player size. How does fullscreen toggling currently work in AS3 -is there a specific AS3 method for fullscreening a specified video object in the swf (without stretching the video player UI in the swf itself), and if so, does it automatically black out the background if the screen format doesn't match the video format? - or do I need to download a class for this?

Positioning video player UI when going fullscreen As opposed to YouTube, I want the player UI to still show up when the video is toggled to fullscreen mode - but as mentioned above, I don't want to stretch its size along with the video. So is there a best practice for repositioning the video player UI to the vertical bottom and horizontal center of the screen when the user clicks full screen? I'm not entirely familiar with what happens to the Flash stage when it goes full screen,. How to deal with not knowing the coordinates of the vertical bottom/horizontal center when screens have different ratios and resolutions?

View 3 Replies

ActionScript :: Toggling Boolean - Always Tracing True For Mouse Click

Sep 11, 2010

This code is written in simple ActionScript, but I'm assuming this problem of mine would occur in all languages that have boolean datatypes. I'm simply clicking the stage so that my boolean variable reverses its value and than traces/prints/logs it's new value. However, it's always tracing true instead of switching between true and false for each mouse click.

var myBool:Boolean;
stage.addEventListener(MouseEvent.CLICK, mouseClickHandler);
function mouseClickHandler(evt:MouseEvent):void {
changeBoolean(myBool);
} function changeBoolean(boolean:Boolean):void {
boolean = !boolean;
trace(boolean);
}

View 2 Replies

ActionScript 3.0 :: Toggling Video Fullscreen And Positioning Videoplayer UI - Best Practice?

Oct 12, 2011

I've landed a project which is centered around building a custom video player with some special functionality (so I can't just use the default Flash video player, unfortunately). I have two small 'problems' in the sense that I could probably solve them myself, but I'd like some input on best practice for solving them: (The project is for Flash Player 10 and the video is intended to run inside a browser.)

Problem 1: Toggling between normal / fullscreen playback Ok, so my custom video player needs to be able to toggle between fullscreen and normal embedded-in-webpage player size. How does fullscreen toggling currently work in AS3 -is there a specific AS3 method for fullscreening a specified video object in the swf (without stretching the video player UI overlay), and if so, does it automatically black out the background if the screen format doesn't match the video format? - or do I need to download a class for this?

Problem 2: Positioning video player UI when going fullscreen As opposed to YouTube, I want the player UI to still show up when the video is toggled to fullscreen mode - but as mentioned above, I don't want to stretch its size along with the video. So is there a best practice for repositioning the video player UI to the vertical bottom and horizontal center of the screen when the user clicks full screen? I'm not entirely familiar with what happens to the Flash stage when it goes full screen, How to deal with not knowing the coordinates of the vertical bottom/horizontal center when screens have different ratios and resolutions?

View 3 Replies

ActionScript 3.0 :: Toggling Variable Inside Enter Frame Loop?

Jan 19, 2012

I'm trying to toggle 2 global Boolean variables inside of an ENTER FRAME loop. "Eating" and "WasEating". When these 2 objects hit each other "Eating" is set to true, and an animation plays to show that my character is eating. When the 2 objects DONT hit, I want to change my "WasEating" variable to true ONLY for that one frame (then setting it back to false), and to change back to the original animation when the Hero was NOT eating.

The issue I'm having is my variable is getting toggled true to false, false to true, every frame, not what I want. I want to have this happen ONLY ONCE, based on the hitTestObject function in the loop. For example:

ActionScript Code:
addEventListener(Event.ENTER_FRAME, loop);
function loop (e:Event):void {

[Code]...

View 2 Replies

ActionScript 3.0 :: Create An Image Gallery By Toggling Between Different Sets Of Thumbnails?

Feb 15, 2012

I'm trying to create an image gallery by toggling between different sets of thumbnails and thus loading the appropriate images.I've set up the first 9 okay and they all load at first but when I toggle back and forth in the toggleThumbnails function using addChild I can no longer load these same movieclips.I'm loading the same movieclip with their associated instance names? How come it no longer interacts with the thumbnails?

ActionScript Code:
import flash.events.MouseEvent;
var thumbnailSet = "setOne";[code].....

View 2 Replies

ActionScript 3.0 :: Flash Sprite Button Not Toggling Sound Volume?

Jul 21, 2010

This is a completely AS3 scripted, and dynamic project, meaning I cant use any assets from the library.

1 - This button is a mute.

� Currently the loaded sound now fades in with a timer.� I want the button to over-ride any sound elements on the stage: the mp3 and later a flv movie as well.� In the below example the button only interferes with fade, and dosen't actually override it, after the fade - it dont do jack. � SoundMixer.stopAll(); will of course kill everything but I cant toggle this(can I?)

2 - The toggle button itself� I've loaded two png's into a sprite, and created a toggle button from them using an if statement. � Is this best practice? or would you recommend something else?� Perhaps SimpleButton?

[code]....

View 1 Replies

Javascript :: YouTube Video Not Playing Correctly After Toggling The Player's Visibility

Mar 26, 2012

I am using YouTube JS API to play videos on my site. Video is played on the dialog box. When user closes the dialog box, player is stopped - player.stopVideo(); But when user clicks again on video icon again, dialog box appears

In Chrome, the video starts playing at the previous position - OK Firefox, the video starts playing from the start irrespective of where user left it last time. - NOT OK

As per my requirements, I want the Chrome to behave as how firefox is behaving.

Here's a fiddle: [URL]

View 1 Replies

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies

Flex :: Toggle - Disable Toggling With Flex Buttonbar?

Oct 12, 2010

How to disable the toggle nature of buttons in spark:Buttonbar so that it would behave similar to mx:ButtonBar?

View 2 Replies

Make MC Repeat Look Better?

Apr 1, 2010

I don't know much about flash.. I've created a MC with tomatoes falling.. when the MC repeats itself, which I want it to, looks too "rough". I am hoping to make the transition a little smoother.. I've read a little about mathematical random function, but it looks so complicated.Here is the flash: http:[url].....

View 4 Replies

Making Random Not Repeat?

Aug 25, 2009

Im wanting to change the variable numSound. At the moment it is a random number 1-5 which works well but I dont want repetition. Tried all sorts of things but no luck.

Code:
private function randRange(min:Number, max:Number):Number
{

[code].....

View 6 Replies

Repeat Only Some Frames Infinitely?

Mar 19, 2010

1. starts with 2 guns crossed centered

2. the shoot at the same time and start dragging towards the edges of the screen like this: <------ (center) ------>

3. fill the centerish area with smoke from the gunfire while the guns are moving away

4. as the smoke clears my name appears in the middle

5. then a few more frames of smoke coming out of the guns (i want this part to repeat, only this part though so theres just infinite smoke coming out)

now i'm still a bit fresh to flash. here's what i have down. i got my gun pics and the tilt up when fired and got them to drag away (motion tween). i also got my name to fade in from a frame in the middle to the end. i still don't know how to make the bang, or smoke (then make the smoke vanish), and then have the last few frames repeat.

View 1 Replies

ActionScript 3.0 :: Random Do Something Without Repeat

Mar 22, 2012

I've 3 movieclip on stage which is mc1,mc2,mc3 at first they are alpha=0 What I want is when i click on revealBtn, 1 of them will show up as alpha=1. But with my code below, sometimes I need to click about 5 times or more only can make all those mc show up.

[Code]..

View 1 Replies

Arrays :: Randomly Do Something Without Repeat?

Mar 22, 2012

I've 3 movieclip on stage which is mc1,mc2,mc3at first they are alpha=0What I want is when i click on revealBtn, 1 of them will show up as alpha=1.But with my code below, sometimes I need to click about 5 times or more only can make all those mc show up.Is there any solution for what I wanted? I've try splice but it's still not working well.

var mcArray:Array = [mc1,mc2,mc3];
for (var j:int = 0; j < mcArray.length; j++)
{

[code].....

View 2 Replies

ActionScript 3.0 :: Random Int Without Repeat

Jan 15, 2009

how i should go about making a function that returns a random int w/out repeating? i was thinking:

[Code]...

would this be sufficient? i'm tracing my output and sometimes i don't see anything. is this because it could take a while to iterate through w/out a repetition and that may cause the variable to be undefined during that call of the function?

View 9 Replies

ActionScript 2.0 :: How To Repeat The Tween

Aug 18, 2009

I designed image viewer and the main functionality of the code is written in an external class - AS file. The connection between the fla file and the external class work ok. In the fla file I added some movie clips as buttons and when I press them, the external pictures are loading successfully.

A) When the picture is loaded, I am using a tween , and the picture is moving inside the screen.For this I call inputfade() function from the external as.

B) When I choose another picture to be loaded, I want the current picture to move outside from the screen, and the new loaded picture to move inside (same as explained in A).For the current picture to move outside I used outputfade() function, and for new loaded picture to move inside I am using the same first function inputfade()

Here is the main code:
//moving inside
public function inputfade(){
var easeType = mx.transitions.easing.Bounce.easeOut;

[code]....

I have a problem with the part, when the picture is moving outside from the screen (when outputfade() is finished,) I can not add new coming tween. (- I can not call any new tween function).It seems that any code related to tween (exept yoyo)or other type of mc motion is blocked after after finishing the function outputfade(). I also add with some trace (�test�); after finishing the inputfade function and the trace work. Also interesting this.yoyo() function works as well after finishing outputfade, which is not same case with calling inputfade();

View 0 Replies

ActionScript 2.0 :: Possible To Repeat LoadVars?

Dec 29, 2009

I have managed to develop code that will run a php script by passing a variable (obtained from a combobox control) to the MySQL database. Initially this works fine but if I try to repeat the excercise using a different value nothing happens.[code]...

View 4 Replies

ActionScript 2.0 :: Random But Don't Repeat?

Jun 21, 2011

I have this code:my_txt.text=a = myArray[Math.floor(Math.random()*myArray.length)];Is there a way to do so that one element in myArray doesnt show more than once. I have tried different methods some days but canït succeed.

View 8 Replies

ActionScript 2.0 :: How To Repeat A For Loop

Jun 13, 2005

anyway cutting to the chase, i need some advice and was wondering if someone could spare a mo to briefly explain what i should do here...

Code:
for (i=0; i<7; i++) {
this["bubble"+i]._x = 0;

[code]....

View 2 Replies







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