Independent volume control of an FLV


So I've been wracking my brain for half the day today and I'm sure I'm just doing something dumb or missing something minor...

I'm trying to control the volume of an flv in a video player I'm making. I want it's volume control to be independent of any other content on the page. The Video object is in a Component if that makes any difference.

I am able to adjust the volume of the root (aka MovieClip(this.parent).soundTransform ) but I cannot do it to the component itself.

I have tried applying the SoundTransform to the component itself (which is not a MovieClip I know), I have tried placing the Video object in a MovieClip inside the component and attempted to adjust the volume that way with no success...
(obviously there's a lot more code than this)
Code: _videoDisplay = new Video(); _videoVolume = new SoundTransform(0); // just using 0 so I can tell when it works this.soundTransform = _videoVolume; // *this refering to the component I've also tried adding the _videoDisplay to a MovieClip and applying the SoundTransform to it with no luck...
Code: _videoContainer = new MovieClip(); _videoDisplay = new Video(); _videoContainer.addChild(_videoDisplay); _videoVolume = new SoundTransform(0); _videoContainer.soundTransform = _videoVolume;
Posted On: Thursday 3rd of January 2013 10:21:56 PM Total Views:  268
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




import mx.controls.Alert; Not working in cs3

1172: Definition mx.controls:Alert could not be found. there is there any particular reason why I can not access the mx classes from flash cs3. or more so where can I get them to install into my class path directory\t many
VIEWS ON THIS POST

162

Posted on:

Thursday 25th October 2012
View Replies!

controlling an external SWF

I can't find a way to control an external SWF in AS3 like I used to be able to in AS2. This used to be a real simple way (among others) in AS2: loadMovieNum("yourMovie.swf",1); onMouseDown = function(){ _level1.stop(); } onMouseUp = function(){ _level1.play(); } Unfortunately this has been abolished in AS3 . To load a SWF externally from a separate SWF file (on a separate CPU) in AS3, you now must now use a URL request along with a load request. However, the SWF is tied into this loader object of which's class does not contain "play", "stop", "currentFrame", "nextFrame", "prevFrame", "gotoAndPlay", "gotoAndStop", etc..... According to the help panel, you can target any of the loader's child's methods by virtue of calling "loader.content".... but it doesn't work. When I trace my "loader.content".... all I get back that it is an [Object Main Timeline] when I would expect it to be [Object MovieClip] if it were to have the methods I need. Inevitably.... I need to do all sorts of gotoAndStop / gotoAndPlay functionality with external SWFs on another CPU. I have a nice XML server running successfully... I just hit this brick wall.... any suggestions thx
VIEWS ON THIS POST

195

Posted on:

Thursday 25th October 2012
View Replies!

controlling a movieclips timeline from within itself

Greetings. How do I control the timeline from a movieclip from within itself I made a menubutton for a school assignment. To make it, I created a movieclip of the button's graphic, with on the second frame the button again but with the menu open (haven't added anything in it yet). Opening the menu is as easy as Code: menu_mc.addEventListener(MouseEvent.CLICK,openMenu); function openMenu(evt:Event):void{ this.menu_mc.gotoAndStop(2); } Inside of the menu is a CLOSE button (just a movieclip) that should, when clicked, take menu_mc back to frame one. A simple gotoAndStop() doesn't work. Using a parent to issue the order to the movieclip doesn't work either. -How can I make menu_mc go back to frame 1 when clicked on inside itself note: I am also open to the suggestion that I'm just going the wrong way about this. I'm really learning as I go here.
VIEWS ON THIS POST

213

Posted on:

Thursday 25th October 2012
View Replies!

positioning my video controls

I need some help figuring out how to position my video controls. I thought I had it figured out until I moved my video and the controls did not move with it. I tried doing this: video.addChildAt(vidControls, 2); but it keeps barking at me. What am I doing wrong Code: video = new Video(); video.width = 640; video.height = 360; video.x = 140; video.y = 130; addChild(video); video.attachNetStream(stream_ns); stream_ns.play(vidSource); //set up video controls var vidControls:MovieClip = new Controls(); addChildAt(vidControls, 2); vidControls.x = 4; vidControls.y = 304;
VIEWS ON THIS POST

102

Posted on:

Thursday 25th October 2012
View Replies!

FLVPlayback component controls

Quick question, How do I make the FLVPlayback component stop playing a video once I leave the frame that it exists on Right now If I go to frame 8, and the video plays, then press a button that sends me back to frame 1, I can still hear the audio of the video playing. I want that video to stop playing once I leave that frame. Easy fix
VIEWS ON THIS POST

89

Posted on:

Thursday 25th October 2012
View Replies!

controlling the browser scrollbar with as3

, I have a simple gallery that rearranges itself when the stage is re sized. Can anyone help me with adding a scrollbar to the browser once the stage size is small enough. I want to add a scrollbar to the browser window when the stage height is reduced below a level.
VIEWS ON THIS POST

273

Posted on:

Thursday 25th October 2012
View Replies!

Controls for swf file (like video controls)

Urgent AS3: I need to "skin" swf files with a video-like control/progress bar (as in www.brainpop.com movies) so user can scrub/back-up after pausing. I have looked extensively and cannot find how to do this.
VIEWS ON THIS POST

101

Posted on:

Thursday 25th October 2012
View Replies!

Unable to control the root timeline from a class

Lately, I've been trying to switch from AS2 to AS3 by forcing myself to use AS3 on every project and never revert to AS2 no matter what the problem may be. Doing this, I've learned a lot so far, and it has shown me that AS3 has the potential to be much more logical and easier to manage, but every once in a while I run into a problem in which research doesn't prevail. At the moment I'm working on a project that uses the Union Platform. My goal is to make all control over User1's "Reactor" API managed by a single class. Anyways, I've ran into a very limiting problem that I can't seem to get by. I can't figure out a way to call the root object and be able to call it's functions from a class! Here's one of the methods that I've tried (No errors were reported, but it did not work) - main.as: Code: package { import flash.display.MovieClip; import net.user1.reactor.Reactor; import net.user1.reactor.ReactorEvent; public class main { protected var reactor:Reactor; protected var rootObject:MovieClip; public function main (rootObject) { reactor = new Reactor(); reactor.addEventListener(ReactorEvent.READY, readyListener); reactor.connect("**********************", ****); } // This function is called when a connection is successfully established with Union server. protected function readyListener(e:ReactorEvent):void { rootObject.nextFrame(); } } } Project.fla, Frame 1: Code: stop(); var union:main = new main(this); As you can see, I tried to pass "this" as a MovieClip in hopes that I would be able to use the MovieClip's class functions. (Which is most likely very nooby and completely wrong since it's probably not considered a MovieClip reference, but what do I know) Everything is fine, except the swf does not go to frame 2 when readyListener() is called. No errors are outputted either.
VIEWS ON THIS POST

77

Posted on:

Thursday 25th October 2012
View Replies!

interface confusion, how to get controller

i'm trying to use org.simplemvc for my first mvc project. i'm getting it piece by piece, but I can't figure out how to get the controller from a class of mine that extends view. I thought it would be as simple as just calling a method from it's super, view, the controller getter. but it tells me the property doesn't exist, so I'm thinking it has something to do with the interface. this is the view class I'm extending: Code: ////////////////////////////////////////////////////////////////////////////////// // // AS3-SimpleMVC - Copyright (c) 2008 Tony Birleffi // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////////////// package org.simplemvc.core { import flash.events.Event; import flash.utils.setTimeout; import flash.display.MovieClip; import org.simplemvc.core.Model; import org.simplemvc.interfaces.IController; import org.simplemvc.interfaces.IView; /** * The View component of the MVC design pattern is a distinct representation of a Model's data and or logic. * A view listens too and represents changes to the model for states of the application or logic. It is * recommended that the views in an MVC system be unaware of the inner workings of the system's * Model (ie. utilize a push only dispatching protocol in which the Model pushes information to * it's listeners through the event object). * * It is the responsibility of each view to make sure it has a controller. The controller can either be * passed in to the constructor or it will be automatically made by the view's. To create an MVC relationship; * a model is created and a view is created which is then added as a listener of its associated model. * The view primarily creates its own controller, but can use an existing one, this is not recommended. * It will be necessary to extend this View class and the core controller method in order to make more * specific view objects for specific view/controller pairings. * * @example * * import org.simplemvc.core.View; * var view:View = new View( model ); * * * @author Tony Birleffi */ public class View extends MovieClip implements IView { /** This view's model */ private var oModel:Model; /** The view's controller */ private var oController:IController; /** * Create the view for the mvc system. * * @param model the model to associate with this view. * @param controller [Optional] the already created controller to associate with this view. */ public function View( model:Model, controller:IController = null ) { // Save properties. oModel = model; // If we have a controller set one. if( oController != null ) oController = controller; // Register events. registerEvents(); } /** * Creates an abstract default controller. If a view handles user input, * this method MUST be overwritten. Otherwise the call will scope up * to the abstract view creating a null controller. * * @return IController; */ public function defaultController():IController { return null; } /** * Register events for the view. */ public function registerEvents():void { // Abstract. } /** * The show method. * * @param event Event. */ public function show( event:Event ):void { // Abstract. } /** * The hide method. * * @param event Event. */ public function hide( event:Event ):void { // Abstract. } /** * Method used to destroy the view and dispatch the next event. */ public function destroy():void { setTimeout( nextEvent, 50 ); } /** * Go to the next event. */ private function nextEvent():void { oModel.sendInternalEvent( oModel.currentEvent ); } /** * Sets this view's model. * * @param model the model object. */ public function set model( model:Model ):void { oModel = model; } /** * Gets this view's model. * * @return Model. */ public function get model():Model { return oModel; } /** * Sets the controller to associate with this view. * * @param controller IController class object. */ public function set controller( controller:IController ):void { oController = controller; } /** * Gets the view's controller instance. * * @return IController. */ public function get controller():IController { return oController; } } }
VIEWS ON THIS POST

90

Posted on:

Thursday 25th October 2012
View Replies!

controlling movieclip from hierarchically equal movieclip

, first flash website. I'm a designer, wanting to make a portfolio website. So i have 4 movieclips on stage, with - when you click on it - a dynamic drop down menu, each placed within these respective movieclips. This works fine. Now I should add next functionality: when the movieclip1 is clicked (and the menu drops down), the other 3 should be with menu dropped in (so one of these three will have a menu dropping back in, while movieclip1 menu is dropping down.) So i guess i could put my question this way: 1) how can i control from within movieclip1 actions in hierarchically equal movieclip2, 3 , 4, ... 2) how to do it efficiently in code I tried already a lot of stuff, please check the fla file in attachment. It's only this step away from a website... http://www.sendspace.com/file/2hluz9
VIEWS ON THIS POST

153

Posted on:

Thursday 25th October 2012
View Replies!

Can't access button in flv skin

Hi I am using a flvplayback component which I have attached to my own skin. I want to be able to target the full screen toggle button since I can't get the fullscreen to work and others posts have led me to think that it might be better to code that bit myself. For the skin fla the button that I want to get at has this written in the properties class box "fl.video.skin.FullScreenButtonOnOver" I figured I might be able to get at this from my main timeline so I added the code below : Code: stop(); function edward(event:MouseEvent):void{ trace ("the button was pressed"); } fl.video.skin.FullScreenButtonOnOver.addEventListener(MouseEvent.CLICK, edward); which doesn't work. It says "access of undefined property fl" - which I can kindof understand.... Anyway, what should I write please to access that button
VIEWS ON THIS POST

141

Posted on:

Thursday 25th October 2012
View Replies!

extending fl.controls.Button

I wanted a Button that would also hold an int as an identifier, so I tried to extend the fl.controls.Button class: Code: package { import fl.controls.Button; class ButtonID extends fl.controls.Button{ public var ID:int; public function ButtonID( setID:int ):void { ID = setID; } } } Simple enough. But when I try to instantiate some ButtonID's in the main, I get Code: TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::LabelButton/draw() at fl.controls::Button/draw() at fl.core::UIComponent/callLaterDispatcher() The flash debugger says it cannot show the source code at the location where the error occurs. I have a Button component into the library, and creating regular buttons still works. The ButtonID's that are created and added to the stage don't have any of the default background images in them. They are just blank with the label text. I'm guessing that the new ButtonID's can't access the default graphics that the regular Buttons are accessing. How could I enable the ButtonID's to get those graphics
VIEWS ON THIS POST

112

Posted on:

Thursday 25th October 2012
View Replies!

XML text: controlling the MC

Hi! I am loading text from an XML file into dynamically created MCs. How do I target those MCs so that I can change where they are, their alpha, etc. For example, I want them to have zero alpha until the image from the XML node they're in is loaded, then make them visible. XML: PHP Code: \t\t \t\tportfolio/01.jpg \t\tone \t\t AS: PHP Code: functionxmlLoaded(e:Event):void{ \t\tvarloadedxml:XML=newXML(e.target.data); \t\tfor(vari:uint=0;i
VIEWS ON THIS POST

155

Posted on:

Thursday 25th October 2012
View Replies!

Parent SWF controlling Child SWF variables

1) The code below works but the browser sends an annoying alert message Received Parent Message and you are obliged to click OK before the program can run. How can it be fixed 2) Why this code needs to use the ExternalInterface class if the Child SWF gets loaded and becomes incorporated in the Parent SWF 3) Is there a simpler and more straightforward way for a Parent SWF to communicate with a Child SWF package { import flash.external.ExternalInterface; import flash.display.Sprite; import flash.text.*; public class ChildMovie extends Sprite { public function ChildMovie():void { // } public function alert(msg:String):void { ExternalInterface.call('alert', msg); txt.text = msg; } } } package { import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; import flash.display.LoaderInfo; import flash.display.Sprite; public class ParentMovie extends Sprite { public function ParentMovie():void { var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, onLoadComplete); loader.load(new URLRequest('ChildMovie.swf')); } private function onLoadComplete(e:Event):void { var loaderInfo:LoaderInfo = e.target as LoaderInfo; addChild(e.target.content); var swf:Object = loaderInfo.content; swf.x = 75; swf.y = 50; swf.alert('Received Parent Message'); } } }
VIEWS ON THIS POST

187

Posted on:

Thursday 25th October 2012
View Replies!

bulleted links: controlling margins / splitting

I have been working on an animation with Actionscript 3.0 (see link below) that utilizes an xml file to dynamically populate a text field with links. I am then putting them into some sort of bulleted list. I am having a problem fine-tuning the formatting of links whether they be in a ul list or some approximated styling. I first put bullet styling in as3. But I could not control the margin spacing between the bullets and the links so it was too big for my the small space for the rounded rectangles. I then tried to put it in an ul html list, same thing, couldn't control that margin space. I don't think Flash/Actionscript allows for this type of formatting. Is this true Then I tried to add a break and a space in the xml. For some reason, flash breaks it into 2 links, even though I put the break and the space within the link. I even tried to put in a placeholder symbol in the xml and then replace it after importing the xml into flash. When Flash parsed the html text. it again broke it into 2 links. I also tried to add the break and the space in the Actionscript, same thing 2 links. (See the first bullet point in the yellow popup). The text needs to indent and not wrap under, any suggestions
VIEWS ON THIS POST

166

Posted on:

Thursday 25th October 2012
View Replies!

controlling main swf through sub swf

i have main fla its name "sections.swf" it loads sub swf files "sec1.swf" that has animation that open window movie clip with instance name "cont" and a close btn inside "cont" with instance name "close" i want to play a specific frame on "mainSection.swf" when i click the "close" button my code: Code: close_btn.addEventListener(MouseEvent.CLICK, closeBox, false, 0, true); function closeBox(evt:MouseEvent):void { // This tell the window to play its timeline cont.play(); // This tell the "mainSection.swf" play its timeline, lets say label "sec1" MovieClip(parent).play("sec1"); }
VIEWS ON THIS POST

163

Posted on:

Thursday 25th October 2012
View Replies!

Adding controls to Swf file

I want to add controls ( slider) to a swf file does anyone know a tutorial or a way to do it I have added the play pause button its making the slider bar to move the video forward or backward that is giving me the problem
VIEWS ON THIS POST

54

Posted on:

Thursday 25th October 2012
View Replies!

Loop multiple flv

Good evening. This is really beginning to stress me out! I have just managed to get an embedded flv to loop...WOO HOO! Even though it's less than perfect as there's a brief pause before it plays again. Please can someone tell me how I go about modifying the script below so as to loop several embedded flvs as apposed to just one import fl.video.*; // Video component instance name var flvControl = clip1; var flvSource = "1.flv"; // Loop the video when it completes function completeHandler(event:VideoEvent):void { flvControl.seek(0); flvControl.play() } flvControl.addEventListener(VideoEvent.COMPLETE, completeHandler); // Set video flvControl.source = flvSource; I've already tried duplicating the script with "clip2" "2.flv" etc...with now success. Please help me!!!!!!!!!!!!!
VIEWS ON THIS POST

64

Posted on:

Thursday 25th October 2012
View Replies!

controlling an embedded movie

I have embedded a move clip into flash. I want to control it, loop and and move to frame. I tried myMovie.stop() and myMovie.gotoAndPlay(20); 1061: Call to a possibly undefined method stop through a reference with static type flash.media:Video.
VIEWS ON THIS POST

144

Posted on:

Thursday 25th October 2012
View Replies!

Side show controlled by buttons help

I would like to create an intro like the one below: http://www.autosofnaples.com/index.htm I have imported the image and made it into a graphic simbol. I tween the image. But I dont know if that is the right thing to do. Can anyone help me Thank you
VIEWS ON THIS POST

97

Posted on:

Thursday 25th October 2012
View Replies!

fzip and flv

I just found this class that can compress/uncompress zip files on the fly for AS3 http://codeazur.com.br/lab/fzip/ Do you think there would be any advantage in loading external FLV files compressed with zip using this class
VIEWS ON THIS POST

59

Posted on:

Thursday 25th October 2012
View Replies!

Related to .flv

I am working at a flex project . There are variuos vide files and variuos .swfs , suppose any user choose a video file and put some effects over that video file (.flv) effects are in .swf format , now i want save all that effects and a .flv video file in a single .flv file . Is it poosible if yes how please reply me as soon as poosible
VIEWS ON THIS POST

47

Posted on:

Thursday 25th October 2012
View Replies!

AS3 , Flex tree control

Im relatively new to AS3 and Flex but here is my problem, at the moment that I am populating a tree in flex from an XML source, my problem is that the tree displays all child nodes of the XML passed to it, and I want it only to display the top node, I have tried using the delete method however I need the children of the XML for other functions, so I thought to create a new XMLList but it also deletes from the original XMLList now aswell My ideal solution would be a way of selecting the top node for the tree but leaving the XML dataProvider intact, is this possible Ive spent 2 days trying to find a solution and havent found anything so far var node2:XML = XML(item); var strLabel:String; if (node2.@NavigationItemType==2) { strLabel = node2.@Caption; } return strLabel; above returns the children of the top node with a blank caption, but you can still expand the tree with invisible items var i:int = 0; var j:int = mapTreeNavXML2.length; for (i=0;i
VIEWS ON THIS POST

78

Posted on:

Thursday 25th October 2012
View Replies!

help please about flv issue

hi everybody, im an actionscript 3 programmer, with some experience but im quite desperate with an issue that i cant solve, please help help, if you know the solution to my issue my email is ideami@gmail.com, thanks so much, i explain now * im building an application in which i have to show many flv videos dynamically, i have tried with both systems, with the FLVPlayback component being created dynamically and with the simpler netconnection and netstream etc way, the thing itself works no probs , the videos get created no probs at all, now the problem is that videos stop playing just after they start, or they play a few times and then they freeze or sometimes they dont even load at all, this happens both locally and remotelly * i read about the MIME video/x-flv issue, i have apache in my computer so i set the MIME right there and i still have the problem, so it doesnt seem that the MIME issue is the problem, even more: * first, to provide context, i have a PC with Windows Vista, and Flash CS3 Professional, and Flash CS3 Video Converter and Riva FLV Encoder, locally i have Apache and PHP installed, remotely a fasthosts server * i have found that if i encode the videos without audio! they almost always work, but here comes the desperating thing, if i encode them without audio, they always load, but they still freeze sometimes.... so if videos have audio, often they dont even load, if they dont have audio, often they work perfect and play, but still after playing 2 times maybe they freeze and they dont play more * i have executed my application in the flash environment, in a browser locally, locally in localhost through apache, and online in a fasthosts server; * i thought i had found something when i realized that if i encoded the videos with no audio they seemed to play well no probs, but i have found that even then they will freeze and stop moving after a while often * to encode i have tried many things! the Flash CS3 video encoder with different settings, and also the RIVA FLV Encoder * i have also , thinking that the kind of video source could be important, i have encoded a couple of different sources with same results, i encoded uncompressed AVIs and also wmvs please anybody can help, as im quite desperate with this, thanks very much, my email is ideami@gmail.com all best and thank you Jav
VIEWS ON THIS POST

72

Posted on:

Thursday 25th October 2012
View Replies!

How do I change the volume of an mp3

I know it has something to do with soundTransform, but I've been trying to get it working for a few hours now and no luck. Here is my code to start the song. If you cant tell by byte array I am making a spectrum analyzer. EDIT: I actually have another question. I have two of the same movie clips, playing 2 different songs and what I thought would happen is they would each have their own spectrum, but turns out they sharing the same sound channel. I tried changing each names of the sound channel but didnt work. Here is my code for clip 1: Code: //BALL1 var s:Sound = new Sound(); var sc:SoundChannel; var ba:ByteArray = new ByteArray(); var array:Array; s.load(new URLRequest("mix2.mp3")); sc = s.play(0,1000); this.addEventListener(Event.ENTER_FRAME, spectrum); var a:Number = 0; function spectrum(event:Event) { a = 0; graphics.clear(); SoundMixer.computeSpectrum(ba,true,0); for (var i=0; i < 256; i=i+8) { a = ba.readFloat(); var num:Number = a*360; graphics.lineStyle(num/15,0xccff33|(num
VIEWS ON THIS POST

78

Posted on:

Thursday 25th October 2012
View Replies!

How to access variables set by SetVariable method of activex control

In AS2, when you call SetVariable in the flash activex control, a variable with the name specified is set in the _root. In AS3 this doesn't work; is there a way to access these variables
VIEWS ON THIS POST

72

Posted on:

Thursday 25th October 2012
View Replies!

flv play button wont work and im UPSET

I am begging for help, ive been at this for days. I cant for the life of me figure out how to get my flv pause button to work. I have a movie clip on the stage called scott_mc. inside is another clip called loader_mc which is masked (the flv attaches to loader_mc). so the video is masked. anyway i want to be able to click the scott_mc on stage and have it pause/unpause. Please tell me the error of my ways. Code: package { import flash.media.*; import flash.utils.*; import flash.display.*; import flash.events.*; import flash.net.*; import fl.video.*; import fl.containers.UILoader; public class Scott extends MovieClip { public function Scott() { var videoConnection:NetConnection = new NetConnection(); videoConnection.connect(null); var videoStream:NetStream = new NetStream(videoConnection); videoStream.play("scott1.flv"); var metaListener:Object = new Object(); metaListener.onMetaData = onMetaData; videoStream.client = metaListener; var video1:Video = new Video(); video1.attachNetStream(videoStream); loader_mc.addChild(video1); video1.width = 162; video1.height = 208; video1.x = 0; video1.y = 0; videoStream.seek(.1); videoStream.togglePause(); function onMetaData (data:Object):void { scott_mc.addEventListener(MouseEvent.CLICK, playMovie); } function playMovie (event:MouseEvent):void { videoStream.togglePause(); } //video size 162 X 208 } } }
VIEWS ON THIS POST

109

Posted on:

Thursday 25th October 2012
View Replies!

Data Grid - addItemAt() - columns have independent indexes?

I am using a data grid component in flash AS3 and I am adding content to it with the addItemAt() method. It works but not as I would like it to. When I add text to column 0 index 0 of the data grid, the text is placed there: Code: var tempData; if(cameraNum==0){ tempData = { col1:""+Data; }else if (cameraNum==1){ tempData = { col2:""+Data}; } addItemAt(tempData, 0) Now when I place text on column 1 index 0 of the data grid the text is placed there but the text in column 0 is pushed down to index 1. Why is this and is there a way to insert text into columns and not have the other column index's change position
VIEWS ON THIS POST

65

Posted on:

Thursday 25th October 2012
View Replies!

AS3 - framerate independent game

im trying to switch my game, that is using onEnterFrame to update the game, over to a timer based update so it will be frame rate independent. how is something like this achieved
VIEWS ON THIS POST

59

Posted on:

Thursday 25th October 2012
View Replies!

Flash How can I zoom the area wherever my cursor is placed?

I want to zoom the area wherever my cursor is placed. I don't want all the area to be zoomed. How can I achieve this Any example code or any link would be a great help for me.Please help
VIEWS ON THIS POST

90

Posted on:

Monday 29th October 2012
View Replies!

jumping to label in main timeline

hey there I am trying to make a button jump to a label in the main timeline from within a movieclip but I dont think i have the syntax etc correct. I'm getting "access of undefined property _root" when I run the following code. Any ideas what I'm doing wrong here heres the code.. menuButton_IN.pHome_IN.addEventListener(MouseEvent .MOUSE_DOWN, onPressHandler); function onPressHandler(myEvent:MouseEvent){ _root.gotoAndPlay ("home"); } ... any help would be great! ... Camm
VIEWS ON THIS POST

61

Posted on:

Monday 29th October 2012
View Replies!

using osmf and AppMeasurement

hi everybody, i'm working on a AS3 project including video reproduction managed with OSMF 1.5. Now i must implement analytics using AppMeasurement.swc. How use AppMeasurement to track data from my video
VIEWS ON THIS POST

98

Posted on:

Monday 29th October 2012
View Replies!

actionscript doesn't work

I have a swf file with 50 frames -At frame 50 I put an actionscript: this.addEventListener(MouseEvent.MOUSE_OVER,gotoAn dPlay(25),false); but when preview, the flash forgets mouse event, it plays from 1-50 then loop 25-50. with error: TypeError: Error #2007: Parameter listener must be non-null. What's wrong here Hope someone help me to point out
VIEWS ON THIS POST

78

Posted on:

Monday 29th October 2012
View Replies!

AS3 help needed

I bet this is simple as hell, but I can't figure it out since I'm kinda new to AS3. Basically I created two movieclips. The first one, named main_menu, holds several mc buttons in a for loop . The other one, named map_mc, holds a map which has several movieclips, with the alpha property set to 0. This movieclips are named map_hlight1, map_hlight2 and so on. Using tweenMax, what I want is to both add a glow filter to the buttons thenselves and change the alpha property of the map_hlight mc's inside map_mc without having to individually add listeners to the buttons. I accomplished the former but not the later. Here is my code Code: stop(); import com.greensock.TweenMax; import com.greensock.easing.*; //buttons rollover & out for (var i:Number=1; i
VIEWS ON THIS POST

70

Posted on:

Monday 29th October 2012
View Replies!

passing a constant as a function parameter

I'm having trouble figuring out how to pass a constant into a function, and then for that function to make use of that constant in its constant form (not the string form). Some code snippets: Code: // make call to play ad, passing a constant value defined in a separate AdType class // in the AdType class, AdType.PREROLL = "before_content" playAd(AdType.PREROLL); private function playAd(adType:AdType) { addWrapper.adType = adType; addWrapper.play(); } I'm getting two errors: -implicit coercion of value of type String to an unrelated type AdType (targeted at the playAd() call) -implicit coercion of value of type AdType to an unrelated type String (targeted at the playAd() function) I realize this is because the value of AdType.PREROLL resolves to a String value ("before_content"), which is then getting passed into the function as such (a String), but is there a way I can make use of that same constant in the playAd function without having to check its string value directly Does that make sense I feel like I'm missing something realllly, reallllly obvious...
VIEWS ON THIS POST

51

Posted on:

Monday 29th October 2012
View Replies!

Is it good practice to use static variables?

Up until now.. I've always used this way to refer to variables on my document class Code: MovieClip(root).variablename But that complicates things because I would need to extend my class as a displayObject and then add it to the displaylist to be able to use "MovieClip(root)" to access the variables in my document class.. as long as variables in my document class are set out as public variables.. I didn't realise you could refer to variables on the document class .. by just using something like : Code: documentclassname.variablename with the the variable on the document class as "public static var". This solves a lot of problems.. as now I do not need to keep adding objects to the displaylist to get access to the document class variables.. Now.. My question is..Since I want to access most of my variables on my document class.. I would need to set them all to "public static var".. Would setting 100 or so variables to "public static var".. have any disadvantages Like performance issues... Or anything else which may make it not be as efficent if I were to keep them simply as "public var" and use "MovieClip(root).variable" to access them
VIEWS ON THIS POST

105

Posted on:

Monday 29th October 2012
View Replies!

how to generate random score ranging from 75 to 100

hi! i'm working on my project on flash 2008 i was wondering how would i generate score randomly from 75 to 100. it will be the scoring of my karaoke project... score = Math.random(); createTextField("dynamic_txt", 1, 10, 10, 150, 30); dynamic_txt.text = score; dynamic_txt.textColor = 0xE3C13E dynamic_txt.border = false; those are my actionscript...i know there isn't much to my codes...
VIEWS ON THIS POST

75

Posted on:

Monday 26th November 2012
View Replies!

Flash CS5 Explode Animation

I have a boulder/rock image that I have turned in to a MovieClip. What I want to do is, have it explode (upon impact with a bullet) so I need to make an explosion animation within the timeline. I have tried doing 'break apart' and then cutting bits away and using a shape tween but it looks awful. What would be the best way to achieve an explode animation with the boulder MovieClip (which is simply this PNG converted to a MovieClip http://www.gemixin.co.uk/images/Boulder.png) within Flash CS5 Also on the same subject, I have the boulder doing a simple rotation animation at the moment (looping from frames 1-25), but would there be a way of adding the explode animation on later frames (maybe frame 50 onwards) so that it doesn't play initially, but only plays when called. For example I can call gotoAndPlay(50) when a bullet hits the boulder, but how can I get it to play only frames 1-25 in the first place and ignore frame 26 onwards until told otherwise Hope that made sense!
VIEWS ON THIS POST

40

Posted on:

Sunday 30th December 2012
View Replies!

SocketServer HTTP POST Request

Hi To debug JAVASCRIPT on remote computer I use jquery post and json encoded data of objects. To receive request I use CHRISTOPHE http://coenraets.org/blog/2009/12/ai...er-socket-api/ SocketServer example works and I have trace of request in my text field. But how can separate headers form body in post request I tried search for "\n\n" but it gives -1; Another question how to detect End of body to close Socket sometimes data coming in multiplay requests. In example all data in ByteArray and reading request looks like this: Code: private function socketDataHandler(event:ProgressEvent):void { var socket:Socket = event.target as Socket; var bytes:ByteArray = new ByteArray(); socket.readBytes(bytes); var fullRequest:String=bytes.readUTFByetes(bytes.bytesAvailable); var headerEnd:int=fullRequest.indexOf("\n\n");// trace -1; ............................................
VIEWS ON THIS POST

61

Posted on:

Monday 31st December 2012
View Replies!