Any way to load songs via streaming website?


I would love to have the ability to load this into my flash component "http://listen.di.fm/public5/trance.asx"

That is live streaming trance, from di.fm. Is there an easy way or a way at all lol

tyty!!
Posted On: Thursday 3rd of January 2013 10:21:18 PM Total Views:  322
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




Flash Need Help in AS 3.0

, I am trying to control a movie clip from the main fla file. Explaining below:-- I have a main file with menu/navigation. In another swf file which is loading on the main fla file. In the another swf file I have a moviclip for example sq1. and I have write the code:-- test2.sq1.visible=false; when this load in main fla file on the click of a btn I want to visible on I write the code like this way:-- MovieClip(this.parent.parent).test2.sq1.visible=tr ue; the swf is loading in holder moviclip. But when I clik on btn the swf is loading but the movieclip is not visible. Don't know what to do Please help me.
VIEWS ON THIS POST

61

Posted on:

Monday 29th October 2012
View Replies!

Flash Typewriting Text effect, looking for further info

Found a somewhat useful tutorial on getting a Typewriter effect for a string of text in AS3. http://lewinzki.com/tutorials/action...ype_writer.php At the end of the Tut, the author mentions being able to recognize characters and creating additional functions, such as pause for a duration when a comma is reached. 1st. Does anyone have or know of such an example I'm not clear on how to script this concept. 2nd. I notice the /n in the string gives a line break effect. Where can I find out what all of these /commands are 3rd. Is it possible to script my own /commands to be called while the typewriter is typing I want to trigger a function at a given point, such as to display a button, and not display the /command as text. I checked a few websites for answers. Apparently I'm not using the right search terms.
VIEWS ON THIS POST

93

Posted on:

Monday 29th October 2012
View Replies!

Flash Runtime Sharing: how to create instance of imported object

! I'm working with Runtime Sharing, and can't get past this issue... In my Import.fla document, I import for Runtime Sharing the movieclip "StarIcon" from Export.swf. It has the class "StarIcon". I can't figure out how to access "StarIcon" via Import.fla's document class. When I try to say Code: var newIcon:StarIcon = new StarIcon(); addChild(newIcon); I get a 1046:Type not found: StarIcon error. If I add that same code to Export.fla, it works fine... but obviously I don't want to use it there. Do I have to do something special in my document class to access the runtime sharing import
VIEWS ON THIS POST

54

Posted on:

Monday 29th October 2012
View Replies!

fill a created MovieClip!

hi i have a movie Clip to stage i want give texture to this MovieClip! how i can it is not round MovieClip !!so i can't to Draw this by Drawing API methods
VIEWS ON THIS POST

86

Posted on:

Monday 29th October 2012
View Replies!

Flash Abstract Class in AS3

I want to know about Abstract class in AS3, its declaration, use and importance with proper example. Can someone help me
VIEWS ON THIS POST

62

Posted on:

Monday 29th October 2012
View Replies!

Flash Flash size

hy! I guess it's a noob question, but I would like to know how I could lower my flash movie without changing quality. I use mostly imported images from Fireworks. I'm asking because my flash is not ready at all and it's already over 1Mb (it's dimensions are 960px * 530px - 30fps). It would be great if you could give me some techniques which can lower my size. I read somewhere that you don't have to create frames if u want something to be longer (tween, etc), there is an actionscript for that, could you share that with me If my size can't be lowered, could u help me by telling some basics how to set up a "loading screen"
VIEWS ON THIS POST

67

Posted on:

Monday 29th October 2012
View Replies!

Flexible Stage Size

I am building a slideshow for cycling through a list of images. This list will necessarily change over time. And I've currently implemented by loading the information on my site into a php array, then looping through that before calling the js slideshow, but it is very difficult to maintain and adjust the look of it among other things. The one benefit is that before I initialize the slideshow, I have the list of images, and I can process through them and determine the max width and height that I will need. I have looked at the swf metadata, but I'm wondering if I can precompute the values before calling the swf metadata, or if there is a solution to emulating the same flexibility I had before. I am also wondering if I can pass the image list data to the swf without having to actually open up the .fla file add new image filenames and then republish the swf I noticed I can pass parameters to the swf file, or xml
VIEWS ON THIS POST

56

Posted on:

Monday 29th October 2012
View Replies!

Facebook updates on own website in AS3

, I've been searching all over google but can't find the answer to my question. I'm looking for some kind of way to publish my status updates that I do on facebook gets showed on my own flash webpage. Is their some possible way or someone that can point me in the right direction By the way i wanna do it like this: 3 dynamic textfields -1 displays my name -1 sets time like "status updated 23 minutes ago" -1 my actual status update wanna have it completely customizable.
VIEWS ON THIS POST

78

Posted on:

Monday 29th October 2012
View Replies!

The creepiest AS3 related video ever.

http://tv.adobe.com/watch/creative-s...obe-flash-cs5/ I mean wtf, really
VIEWS ON THIS POST

45

Posted on:

Monday 29th October 2012
View Replies!

MOUSE_DOWN, MOUSE_UP events works only if I set the style to my SkinnableContainer

I am designing a physics container. Don't worry, my question is not about the physics. Here is my code. Noticed that I have a SetStyle statement there. I realized that if I don't have that line, the MOUSE_DOWN, MOUSE_UP events won't work. If I do have that line, then those events works fine. Anyone know the reason Code: package components { import flash.events.MouseEvent; import spark.components.SkinnableContainer; public class Test extends SkinnableContainer { private var mouseDown:Boolean; public function Test() { super(); //setStyle("backgroundColor", "0xBBBBBB"); addEventListener(MouseEvent.MOUSE_DOWN, mouseDownEventHandler); addEventListener(MouseEvent.MOUSE_UP, mouseUpEventHandler); } private function mouseDownEventHandler(mouseEvent:MouseEvent):void { mouseDown = true; } private function mouseUpEventHandler(mouseEvent:MouseEvent):void { mouseDown = false; } } }
VIEWS ON THIS POST

112

Posted on:

Monday 29th October 2012
View Replies!

Flash [HELP FLASH!!] Separate the string data into different variables?

Hi peeps, I have a string that is sent from PHP to Flash. When I Trace the string in flash, it prints the followings: First Name: Mickey Last Name: M Designation: Mouse Email: Mouse@yahoo.com Mobile: 12345678 Office: 12345678 Company: Mickey House I would like to ask if there is a way to separate the string line by line and put them into different variables in Flash. For example: The first line I want to save it in Variable_A. So when I Trace(Variable_A), it will print out: First Name: Mickey For example: The second line I want to save it in Variable_B. So when I Trace(Variable_B), it will print out: Last Name: M Help is appreciated !!
VIEWS ON THIS POST

78

Posted on:

Monday 29th October 2012
View Replies!

Overlapping MovieClips and Roll Overs

, first time posting here but these forums have been a godsend to me for a while. Basically, I have a project with over a hundred movie clips placed on the stage that play a different sound when you roll over them. The effect I'm trying to create is when the mouse cursor is near two or more of the movieclips, it will play them all. The way I'm attempting at the moment is to have an invisible boundary around each movieclip, that extends the rollover zone so when the mouse is near, the sound plays. This all works apart from when you hover over an area where two boundaries overlap, it only fires the rollover for the movie clip that has the higher index. Is there a way of detecting a rollover on a movieclip that is behind another one on the stage Am I approaching this wrongly or could there be something else causing this problem. Would be really grateful for any help, or any alternative suggestions on how I could do this. Cheers .
VIEWS ON THIS POST

58

Posted on:

Monday 29th October 2012
View Replies!

Passing Dynamic XML Via URLVariables

I have XML I'm dynamically creating and want to pass to a swf via URLVariables. What I have right now is the following: var urlReq:URLRequest = new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.data_file = "us/data.xml"; //data.xml is static/already created urlReq.data = variables; ldr.load(urlReq); What I would like to do is be able to replace "us/data.xml" (which is a static file already created on the system) with the XML that I'm creating in my ActionScript file.
VIEWS ON THIS POST

33

Posted on:

Monday 29th October 2012
View Replies!

Button BOONdoggle

i move the dock button to the base that the player can dock at currently and it works but i get a border at first (see below) then when i click it it goes away like this how can i fix this (btw in the button properties show border is not selectable)
VIEWS ON THIS POST

42

Posted on:

Monday 29th October 2012
View Replies!

Error #2009: This method cannot be used on a text field with a style sheet.

I keep getting this errors when i put the style in (texts in red) for (var i:int = 0; i < 49; i++) { txtSong.appendText(sname(_xmlList[i]["songTitle"] + " ")); txtSong.appendText(sartist(_xmlList[i]["songArtist"] + "\n")); } i was wondering why is it not working
VIEWS ON THIS POST

79

Posted on:

Monday 29th October 2012
View Replies!

Flex Help needed "tabEnabling" not working in simple login page

Friends, I need a small help in Flex. I am doing a simple login page application in FlashBuilder 4.0 & i have kept 2 input boxes like Login,Password and a submit buttion. On clicking the button i am calling a method, so far everything is working fine.... But some how tabenabling is not working. suppose if you are in login inputbox and i press "tab key" it has to go to password input box.. but its not working. can any one help me on this, why it is not working. i have tried all the attempts using tabEnabled = "true". but stil i am failing to do this. i am attaching the code as a text file along with this. pls go thru it. your help would be appreciated. Rajesh
VIEWS ON THIS POST

113

Posted on:

Monday 29th October 2012
View Replies!

Flash Need your quick input

Please visit http://marcinbauer.com/work/bench and paste the numbers that are generated, along with your: - CPU type - Mhz speed - browser type I need this info in order to scale the quality/quantity properties of my project.
VIEWS ON THIS POST

92

Posted on:

Monday 29th October 2012
View Replies!

TypeError: Error #1009: Cannot access a property or method of a null object reference

, I am using this method to create a slider to control frames in a movie clip. var bounds:Rectangle=new Rectangle(SliderControl_MC.x,SliderControl_MC.y,17 8,0); SliderControl_MC.addEventListener(MouseEvent.MOUSE _DOWN,dragScroll); function dragScroll(e:MouseEvent):void { SliderControl_MC.startDrag(false,bounds); } stage.addEventListener(MouseEvent.MOUSE_UP,dropScr oll); function dropScroll(e:MouseEvent):void { SliderControl_MC.stopDrag(); } The slider works well when I'm in the scene that contains the slider. When I go to a scene that does not include the slider, I get the following output error. TypeError: Error #1009: Cannot access a property or method of a null object reference. How can I stop the stage.add.EventListener when I navigate to other scenes that don't include the slider. This is my first as3 project. The project functions as it should but I don't know if the output error will cause problems later. Thank you for your help.
VIEWS ON THIS POST

75

Posted on:

Monday 29th October 2012
View Replies!

Removing children individually

Hi! I've been sitting with this code for way too long now and need some new perspective to help. Watch out for a huuuge lump of code below I'm trying to make an animation that with a few bouncy balls that on collision spawns 1 extra ball, and this i've managed and contained so no more balls are spawned when the population reaches 20, however i need to find a way to remove the balls, i've tried arrays, removeChild and pretty much all that i can think of, but no luck so far (i guess im not that familliar with Action scripting yet) Below is my mess of a code for collision control, and yes it is a mess for now and i intend to clean it up as soon as i can find a way to remove the balls individually... PHP Code: package{importflash.display.MovieClip;importflash.display.Stage;importflash.events.Event;importflash.events.KeyboardEvent;\tpublicclassBallCollisionextendsMovieClip{\tprivatevarmcBallContainer:MovieClip;\tpublicvarbacteria:Array=newArray();\tpublicvarnNumBalls:Number=5;\tpublicvarnNumSpawned:Number=5;\tprivatevarcollision:uint=0;\tpublicvarmyString:String=String(nNumSpawned);\tprivatevarnStageWidth:Number=500;\tprivatevarnStageHeight:Number=400;\tpublicfunctionBallCollision():void\t{\t\tmcBallContainer=newMovieClip();\tmcBallContainer.x=mcBallContainer.y=0;\tstage.addChild(mcBallContainer);\t\tthis.addEventListener(Event.ENTER_FRAME,enterFrameHandler);\t\tfor(vari=0;i
VIEWS ON THIS POST

65

Posted on:

Monday 29th October 2012
View Replies!

XML Drop down menu

I'm having issues with the following menu. I've been adapting a script from here into actionscript 3. When I get to the last level of the menu it won't link properly. It always takes the last url of the bunch as the url for all links in that branch of the tree. Can anyone help me get it to link properly A zip with the fla and the xml can be found at the following link. www.jdviz.com/projects/xmlmenu.zip
VIEWS ON THIS POST

53

Posted on:

Monday 29th October 2012
View Replies!

Flash how to loop my code

i've simple code for my project, when it finishes, it just stays with no repeating. any help how to loop that code code is: Code: import com.greensock.*; import fl.transitions.*; import fl.transitions.easing.*; import flash.display.StageAlign; var slika1:MovieClip = new slika1_mc(); addChild(slika1);with(slika1){x=399,y=265}; TweenLite.to(slika1, 5, {x:399,y:-47.5,delay:1.2}); var logo:MovieClip = new logo_mc(); addChild(logo);with(logo){x=100,y=100}; TweenLite.to(logo, 3, {scaleX:5, scaleY:5,delay:1.2}); TransitionManager.start(logo, {type:Photo, direction:Transition.IN, duration:6, easing:None.easeNone}); setTimeout(bljesak1,7000); function bljesak1 () { TransitionManager.start(slika1, {type:Photo,direction:Transition.OUT, duration:2, easing:None.easeNone}); } var slika2:MovieClip = new slika2_mc(); setTimeout(acSlika2,7500); function acSlika2 () { addChild(slika2); with(slika2) {x=265,y=399}; TweenLite.to(slika2, 6, {x:409,y:50,delay:0.5,onComplete:bljesak2}); } function bljesak2 () { TransitionManager.start(slika2, {type:Photo,direction:Transition.OUT, duration:2, easing:None.easeNone}); } }
VIEWS ON THIS POST

63

Posted on:

Monday 29th October 2012
View Replies!

Loading Multiple Dynamic Images - Issue (anyone experience this?)

Hi I am loading in dynamic images. Sometimes they don't always load. I don't believe anything is wrong with my loading code, only because I can get them to all load. It might take refreshing the program to do it, but they do all load. Also, those that don't display (I have them addChild once they are done loading), I can still trace out as movieClips so I know they exist, I know that they loaded, they just haven't displayed properly. Do I need to wait until the Stage is done loading Do I need to wait on something else prior to addChild on the loaded images They all go through the progressEvent perfectly, as I mentioned, and they all are 100% complete, just not displaying. This might be confusing, but any help would be great without you having to dive into the code. Maybe some tricks you have used in the past Maybe I should load one, wait till that is completely done loading, before I try to load the next As it is now, They don;t have to be 100% complete before the next image begins loading, so don't know if that is an issue.
VIEWS ON THIS POST

80

Posted on:

Monday 29th October 2012
View Replies!

Could you explain draw() while using clipRect?

, I've tried working this problem out several times, but I've never been able to get it to work. What I want to do is draw a PART of a bitmapdata onto another bitmapdata while using transparency effects. My code looks something like this: Code: bmdScreen.draw(bmdSource,new Matrix(1,0,0,1,this.x,this.y),new ColorTransform(1,1,1,.5,1,1,1,.5),null,new Rectangle(1,1,32,32)); The problem SEEMS lies in the new Rectangle. Whenever I try using it, nothing gets drawn onto bmdScreen. So, what's the deal How would I draw a 32X32 rectangle of bmdSource while using the draw method Is this even possible (By the way, the only way I found a workaround to this is to create a separate bmdSource that is the rectangle itself. It's kind of a clunky system and it'd be nice to do away with it.)
VIEWS ON THIS POST

66

Posted on:

Monday 29th October 2012
View Replies!

Static Text - Background Not Transparent - Need Help!

I am writing a large tutorial using flash. The background stage for text is grey (rgb = decimal 99 101 99). I noticed that my static text fields appear to have a background and or hash-pixelated fill that is quite annoying. It is worse for static text fields with a filter applied--their backgrounds are almost green over the grey... Is there a fix for this
VIEWS ON THIS POST

48

Posted on:

Monday 29th October 2012
View Replies!

better to use SWF vs movieclip

I have an animtion in which I have the background slowly easing away from the user while a movieclip slowly eases in. The problem I am seeing is that the movieclip acts jumpy, especially the text inside of it. So I am wondering if anyone has any suggestions as to hoe to get the thing to be less jumpy/twitchy. I was wondering if loading an external SWF and using that in place of the movieclip might help stabalize things. Any suggestions
VIEWS ON THIS POST

66

Posted on:

Monday 29th October 2012
View Replies!

Help needed converting AS2 form to AS3 Options

Hi folks. I've got some banner work to do in AS3 but I'm not sure how I'd implement the following AS2 form function. Can anybody give me any ponters Code: function fSendForm() { var lvSend:LoadVars = new LoadVars(); my_cc = ""; if (_root.clickTAG.substr(0,4) == "http") { sClickTag = _root.clickTAG; } else if (_root.clickTag.substr(0,4) == "http") { sClickTag = _root.clickTag; } my_cc = sClickTag.substring(sClickTag.lastIndexOf("www.mydomain.co.uk")); sURL = "http://www.mydomain.co.uk/ep/ebu.plmname=" + input_name.text + "&phone=" + input_phone.text + "&cc=" + my_cc; lvSend.load(sURL); gotoAndPlay(2); }
VIEWS ON THIS POST

136

Posted on:

Monday 29th October 2012
View Replies!

same class within two swfs

Can I expect there to be any problems with using the same custom event class in two different swfs, and then using this class to dispatch these events from a loaded child swf to its parent wrapper swf If so, is there any better way to do this Should I instead be calling a public function in the parent wrapper (like a callback), and pass it the data that way instead If not -- if it will work perfectly fine -- will I ever have to worry about changing code within any of the *other* classes, and recompiling one or the other (either parent of child) separately
VIEWS ON THIS POST

96

Posted on:

Monday 29th October 2012
View Replies!

[AIR] How do you change (get rid of) Window chrome?

Alrighty I now plan to use this thread to ask questions that I can not figure out after extensive searching. Feel free to ignore me or move the thread, I don't really know where this fits. First question! How the heck to do I get rid of the window chrome I've read a lot in liveDocs but it doesn't seem to be something I can put into the mxml file.
VIEWS ON THIS POST

86

Posted on:

Monday 29th October 2012
View Replies!

Document class vs manual instance of the same class

Same class gives me different results when called from Properties panel(declared Document Class) than called manually. I mean a have a class called Login and when I make an instance of this class PHP Code: varlog:Login=newLogin(); doesn't give me the wanted results... - When it is declared Document class it adds a child on stage - When the same class is called manually (via the above code) although I get no errors nothing is added on stage. Any clue
VIEWS ON THIS POST

83

Posted on:

Monday 29th October 2012
View Replies!

30 minute progressive download FLV

Ok I have this 30 minute FLV that is progressively downloaded. The app also has chapter points that the user can click. This was orginally being built for use on a CD rom, but now they want it on the web things are changing..ughhh.. Anyway, my solution is to disabled all the chapter points until the FLV has loaded to that chapter point. How can I figure that out how much (in seconds) of the FLV has loaded
VIEWS ON THIS POST

94

Posted on:

Monday 29th October 2012
View Replies!

is '*' appropriate?

When is the use of variable type '*' appropriate
VIEWS ON THIS POST

41

Posted on:

Monday 29th October 2012
View Replies!

VAST Video Ad Server Templates

Hi , Has anyone here used VAST on their custom players I'm trying to find a discussion on it but I'm not able to find anything. I did read some info on the http://www.openvideoads.org website but they don't explain much about integrating with custom players. I'd love to talk to more people about it if possible.
VIEWS ON THIS POST

94

Posted on:

Monday 29th October 2012
View Replies!

Application architecture difficulties.

Hi I'm writing (the very first program with more than 90% of code written by me) a program which should calculate the payment based on time - a parking meter essentially. It's working, and all, however I'm not able to properly implement the error handling - the app seem to enter an endless loop and I just can't figure where. The app must be fool-proof, that's why I've hardcoded cursor positions. I've got a feeling that although the program doing it's job it could be shorter/more elegant, which would probably help resolve the error handling issue. The only error handled now is entering time which is in future relatively to machine's local time. package { import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.events.KeyboardEvent; import flash.events.MouseEvent; import flash.net.URLRequest; import flash.text.*; import flash.ui.Keyboard; [SWF(width="550", height="400", backgroundColor="#FFFFFF", frameRate="60")] public class ArgamanTimeCalc extends Sprite { public var format:TextFormat = new TextFormat(); public var localFormat:TextFormat = new TextFormat() public var output:TextField = new TextField (); public var colon:TextField = new TextField (); public var localClock:TextField = new TextField (); public var input:TextField = new TextField (); //obsolete public var input1:TextField = new TextField (); //input field for tens of hours public var input2:TextField = new TextField (); //input field for hours public var input3:TextField = new TextField (); //input field for tens of min public var input4:TextField = new TextField (); //input field for tens of hours public var theDate:Date = new Date (); public var currentDate:String; public var currentTime:String; public var currentMin:String; public var currentHour:String; public var currentMinInt:int; public var currentHourInt:int; public var hours:int; public var minutes:int; public var calcDone:Boolean = false; public var formFull:Boolean=false; public var parkStartHour:int; public var parkStartMin:int; public var parkedHours:int; public var parkedMins:int; public var totalParkedMins:uint; public var parkPayment:Number; public var hoursToPay:uint; public var quarterHoursToPay:int; public var timeTooLateErrorMessage:String="TIME MUST BE EARLIER"; public var errorCode:uint=0; public function ArgamanTimeCalc():void { startCalc(); } public function startCalc():void { trace ("startCalc()"); errorCode=0; trace("output text in startcalc "+output.text); calcDone=false; formFull=false; parkPayment=0; setupTextfields(); stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler); stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler); } public function setupTextfields():void { trace ("setupTextFields"); //set the text format object format.font = "Helvetica"; format.size = 25; format.color = 0xFF0000; format.align=TextFormatAlign.LEFT; //set the text format object localFormat.font = "Helvetica"; localFormat.size = 100; localFormat.color = 0xFF0000; localFormat.align=TextFormatAlign.LEFT; //configure the output text fiels output.defaultTextFormat = format; output.width = 200; output.height = 100; output.border = true; output.wordWrap = true; //configure the output text fiels localClock.defaultTextFormat = localFormat; localClock.width = 270; localClock.height = 100; localClock.border = true; localClock.wordWrap = false; //configure the output text fiels colon.width = 20; colon.height = 50; colon.border = true; colon.wordWrap = true; //display and position the output text field stage.addChild(output); output.x=125; output.y=230; //display and position the output text field stage.addChild(localClock); localClock.x=120; localClock.y=30; //display and position the output text field stage.addChild(colon); colon.text=":"; colon.x=180; colon.y=150; //configure the input text field format.size = 60; input.defaultTextFormat = format; input.width = 160; input.height=60; input.border = true; input.type = "input"; input.maxChars = 4; input.restrict = "0-9"; input.background = true; input.backgroundColor = 0xCCCCCC; input.text = ""; //configure the input text field format.size = 60; input1.defaultTextFormat = format; input1.width = 40; input1.height=60; input1.border = true; input1.type = "input"; input1.maxChars = 1; input1.restrict = "0-2"; input1.background = true; input1.backgroundColor = 0xCCCCCC; input1.text = ""; //configure the input text field format.size = 60; input2.defaultTextFormat = format; input2.width = 40; input2.height=60; input2.border = true; input2.type = "input"; input2.maxChars = 1; input2.restrict = "0-9"; input2.background = true; input2.backgroundColor = 0xCCCCCC; input2.text = ""; //configure the input text field format.size = 60; input3.defaultTextFormat = format; input3.width = 40; input3.height=60; input3.border = true; input3.type = "input"; input3.maxChars = 1; input3.restrict = "0-5"; input3.background = true; input3.backgroundColor = 0xCCCCCC; input3.text = ""; //configure the input text field format.size = 60; input4.defaultTextFormat = format; input4.width = 40; input4.height=60; input4.border = true; input4.type = "input"; input4.maxChars = 1; input4.restrict = "0-9"; input4.background = true; input4.backgroundColor = 0xCCCCCC; input4.text = ""; //display and position input field //stage.addChild(input); //input.x=70; //input.y=150; stage.addChild(input1); input1.x=100; input1.y=150; stage.addChild(input2); input2.x=140; input2.y=150; stage.addChild(input3); input3.x=200; input3.y=150; stage.addChild(input4); input4.x=240; input4.y=150; stage.focus=input1; trace ("output text - end of text field fucn. "+output.text); } public function calcTime():void { trace("calcTime()"); errorsHandler(); if (errorCode==0) { calculator(); output.text = String(parkPayment); } calcDone=true; trace ("calcTime function end"); } public function calculator():void //payment is calculated here { trace ("calculator()"); CurrentTime(); parkStartHour=int(input1.text+input2.text); parkStartMin=int(input3.text+input4.text); hours=(parkStartHour==0) 0:hours; parkedHours=hours-parkStartHour; parkedMins=minutes-parkStartMin; trace ("PArked hours mins"+parkedHours+":"+parkedMins); totalParkedMins=parkedMins+parkedHours*60; trace ("totalParkedMins "+totalParkedMins); if (totalParkedMins>=8) { quarterHoursToPay=(totalParkedMins)/15+1; } else { parkPayment=0; } trace ("QH"+quarterHoursToPay); if (quarterHoursToPay1) { parkPayment=14; } else if (quarterHoursToPay>4) { parkPayment=(quarterHoursToPay-4)*3.5+14; trace("QH>60 "+quarterHoursToPay); } if (parkPayment>40) { parkPayment=40; } } public function errorsHandler ():void { if (parkStartHour > hours || (parkStartHour>= hours && parkStartMin >= minutes)) { errorCode=1; } errorCodesHandler(); } public function errorCodesHandler():void { if (errorCode==1) { trace (errorCode); output.text=timeTooLateErrorMessage; calcDone = true; errorCode==0; } } public function keyPressHandler(event:KeyboardEvent):void { if (calcDone == true) { pauseAndReset(); } else if (event.keyCode==Keyboard.ENTER) { trace (input.text); calcTime(); } } public function CurrentTime():void { //trace ("CurrentTime()"); theDate = new Date; currentHour=String(theDate.getHours()); currentMin=String(theDate.getMinutes()); currentHour=(currentHour.length == 1) "0" + currentHour : currentHour; currentMin=(currentMin.length == 1) "0" + currentMin : currentMin; currentTime=currentHour+":"+currentMin+"\n"; hours=(uint(currentHour)==0) 24 : hours; minutes=uint(currentMin); } public function pauseAndReset ():void { stage.removeEventListener(Event.ENTER_FRAME,enterFrameHandler); stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler); stage.addEventListener(KeyboardEvent.KEY_DOWN, pauseHandler); trace ("pause and reset called"); trace (calcDone); startCalc(); } public function pauseHandler(event:KeyboardEvent):void { trace("pauseHandler"); if (event.keyCode==Keyboard.ENTER) { trace (input.text); } } public function enterFrameHandler (event:Event):void { CurrentTime(); localClock.text=currentTime; trace(calcDone); if (calcDone != true ) { fieldFocus(); } } public function fieldFocus():void { if (calcDone == true) { pauseAndReset(); } if ((calcDone!==true && errorCode==0) && formFull!==true) { if (input1.length==1) { stage.focus=input2 } if (input2.length==1) { stage.focus=input3 } if (input3.length==1) { stage.focus=input4 } if (input4.length==1) { formFull=true; } } } /*public function VariablesReset ():void { format:TextFormat = new TextFormat(); localFormat:TextFormat = new TextFormat() output:TextField = new TextField (); colon:TextField = new TextField (); localClock:TextField = new TextField (); input:TextField = new TextField (); //obsolete input1:TextField = new TextField (); //input field for tens of hours input2:TextField = new TextField (); //input field for hours input3:TextField = new TextField (); //input field for tens of min input4:TextField = new TextField (); //input field for tens of hours theDate:Date = new Date (); currentDate:String; currentTime:String; currentMin:String; currentHour:String; currentMinInt:int; currentHourInt:int; hours:int; minutes:int; calcDone:Boolean = false; formFull:Boolean=false; parkStartHour:int; parkStartMin:int; parkedHours:int; parkedMins:int; totalParkedMins:uint; parkPayment:Number; hoursToPay:uint; quarterHoursToPay:int; timeTooLateErrorMessage:String="TIME MUST BE EARLIER"; errorCode:uint=0; }*/ } }
VIEWS ON THIS POST

57

Posted on:

Saturday 10th November 2012
View Replies!

Pong Game AS3.0 Problem: Make all balls disappear when 1 of them lands

What I'm trying to do is a pong game in Actionscript 3.0 in which, once one of the balls go past the paddle, all the balls on screen disappear. The software I'm using is FlashDevelop 4.0.1. Here's the code: Main: package { import flash.display.Sprite; import flash.events.Event; /** * ... * @author Migs Rebueno */ public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point trace(" World!\n"); trace("Welcome to FlashDevelop!"); var myString: String = "Score: "; trace(myString + 10); trace("Watch the blue ball bounce!!"); var GGClass: GameGlobals = new GameGlobals(); addChild(GGClass); var GameClass: Game = new Game(); addChild(GameClass); } } } Class codes: Circle (which is the ball): package { import flash.display.Sprite; import flash.events.Event; import flash.geom.Point; import flash.text.engine.JustificationStyle; import flash.utils.getTimer; /** * ... * @author Migs Rebueno */ public class Circle extends Sprite { public var location: Point = new Point(); public var radius: Number = 50; public var vector:Point; public var speed: Number = 400; public var prevTime: Number; public var hit: Boolean = true; public function Circle() { this.x = 100; this.y = 200; vector = new Point(1, 1); draw(); } private function draw(): void { graphics.clear(); graphics.beginFill(0x0000FF); graphics.drawCircle(0, 0, 50); graphics.endFill(); addEventListener(Event.ENTER_FRAME, Update); prevTime = getTimer(); } public function Update(e:Event): void { //ball speed this.x += speed * vector.x * ((getTimer() - prevTime) / 1000); this.y += speed * vector.y * ((getTimer() - prevTime) / 1000); //ball wall hit limits if (this.x < radius) { hit = true; vector.x = 1; } if (this.x > this.stage.stageWidth - radius) { hit = true; vector.x = -1; } if (this.y < radius) { hit = true; vector.y = 1; } if (this.y > this.stage.stageHeight - radius) { this.parent.removeChild(this); this.removeEventListener(Event.ENTER_FRAME, Update); GameGlobals.gameover = true; //GameGlobals.Instance.MigsCircle = null; var index:int = GameGlobals.Instance.MigsCircleArr.indexOf(this); GameGlobals.Instance.MigsCircleArr.splice(index, 1); for (var i:int = 0; i < GameGlobals.Instance.MigsCircleArr.length; i++) { var currCircle:Circle = GameGlobals.Instance.MigsCircleArr[i]; //do remove circle in list this.removeEventListener(Event.EXIT_FRAME, Update); } } if (this.hitTestObject(GameGlobals.Instance.MigsPaddle)) { if (hit == true) { GameGlobals.Instance.score++; hit = false; } vector.y = -1; //when ball hits paddle, reverse y axis direction if (GameGlobals.Instance.score > GameGlobals.Instance.highscore) { GameGlobals.Instance.highscore = GameGlobals.Instance.score; } } prevTime = getTimer(); } public function set Diameter(num: Number): void { radius - num / 2; } public function get Diameter(): Number { return radius * 2; } //angle Getters and Setters private var _angle: int; public function set angle(num: Number): void { if (_angle > 180) _angle = 180; else if (_angle < -180) _angle = -180; } public function get angle(): Number { return _angle; } } } CircleSpawner (the class that makes the game make new balls appear in a set interval: package { import flash.display.Sprite; import flash.events.Event; import flash.utils.getTimer; /** * ... * @author Migs Rebueno */ public class CircleSpawner extends Sprite { public var startTime: int = 0; public var spawnIntervalTime: Number = 2.0; public function CircleSpawner() { addEventListener(Event.ADDED_TO_STAGE, init); } public function init(e:Event):void { startTime = getTimer() / 1000; addEventListener(Event.ENTER_FRAME, update) } public function update(e:Event):void { if ((getTimer() / 1000) - startTime > spawnIntervalTime) { //add a new circle every two seconds var myCircle:Circle = new Circle(); this.parent.addChild(myCircle); GameGlobals.Instance.MigsCircleArr.push(myCircle); startTime = getTimer() / 1000; } } } } The paddle class (I called this class Paddlez just for my own fun): package { import flash.display.Sprite; import flash.events.Event; import flash.geom.Point; import flash.text.engine.JustificationStyle; import flash.utils.getTimer; import flash.events.KeyboardEvent; import flash.ui.Keyboard; /** * ... * @author Migs Rebueno */ public class Paddlez extends Sprite { public var keyboard:Array; public var location: Point = new Point(); public var len: Number = 100; public var wid: Number = 30; public var vector:Point = new Point(1, 1); public var speed: Number = 400; public var prevTime: Number; public function Paddlez() { draw(); this.addEventListener(Event.ADDED_TO_STAGE, init); //addEventListener(KeyboardEvent.KEY_UP, onkeyup); } public function init(e:Event):void { this.stage.addEventListener(KeyboardEvent.KEY_DOWN, onkeydown); } private function draw(): void { graphics.clear(); graphics.beginFill(0x0000FF); graphics.drawRect(375, 550, len, wid); graphics.endFill(); prevTime = getTimer(); } public function onkeydown(e:KeyboardEvent):void {//padle movement by keyboard switch (e.keyCode) { case (Keyboard.LEFT): this.x -= 25; break; case (Keyboard.RIGHT): this.x += 25; break; } if (this.x < -375) { this.x = -375; } if (this.x > 325) { this.x = 325 } } public function onkeyup(e:KeyboardEvent):void { e.keyCode == Keyboard.RIGHT; e.keyCode == Keyboard.LEFT; } } } Game class (which is basically the main game class itself): package { import flash.display.Sprite; import Circle; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; import Paddlez; /** * ... * @author Migs Rebueno */ public class Game extends Sprite { public var Score_Text:TextField; public var High_Score:TextField; public function Game() { //GameGlobals.Instance.MigsCircle = new Circle(); GameGlobals.Instance.MigsPaddle = new Paddlez(); //addChild(GameGlobals.Instance.MigsCircle); addChild(GameGlobals.Instance.MigsPaddle); addChild(new CircleSpawner()); Score_Text = new TextField(); Score_Text.text = "Score: " + GameGlobals.Instance.score; addChild(Score_Text); High_Score = new TextField(); High_Score.text = "High Score: " + GameGlobals.Instance.highscore; High_Score.width = 100; High_Score.y = 12; addChild(High_Score); addEventListener(Event.ENTER_FRAME, Update); } public function Update(e:Event):void { if (GameGlobals.Instance.MigsCircle == null) { GameGlobals.Instance.MigsCircle = new Circle(); addChild(GameGlobals.Instance.MigsCircle); //respawn the circle when it lands GameGlobals.Instance.score = 0; //when paddle does not hit ball and when it hits the lower side, reset score to 0 if (GameGlobals.Instance.MigsCircle.y == 1) {//remove circles if one ball hits the floor removeChild(GameGlobals.Instance.MigsCircle); removeEventListener(Event.EXIT_FRAME, Update); } } Score_Text.text = "Score: " + GameGlobals.Instance.score; if (hitArea == true) { GameGlobals.Instance.highscore++; hitArea == false; } High_Score.text = "High Score: " + GameGlobals.Instance.highscore; } } } The GameGlobals class which contains global elements for the game: package { import flash.display.Sprite; import flash.events.KeyboardEvent; import Circle; import Paddlez; /** * ... * @author Migs Rebueno */ public class GameGlobals extends Sprite { public static var gameover:Boolean = false; private static var _instance:GameGlobals = null; public var MigsCircle:Circle; public var MigsPaddle:Paddlez; public var score:int = 0; //starting point public var highscore:int; //high score public var keyboard:Array = new Array(); public var MigsCircleArr = new Array(); public function GameGlobals() { } public static function get Instance():GameGlobals { if (_instance == null) { _instance = new GameGlobals(); } return _instance; } public function keyup(e:KeyboardEvent):void { keyboard[e.keyCode] = false; } public function keydown(e:KeyboardEvent):void { keyboard[e.keyCode] = true; } } } (Added this class but it isn't necessary, which is called GlobalConst: package { /** * ... * @author Migs Rebueno */ public class GlobalConst { public static const GRAVITY:Number = 9.8; public static function square(i:Number):Number { return i * i; } } } ) Anyway, the only problem now is that my pong game is in an infinite loop where, when the ball lands, the score will keep increasing and balls will just keep spawning in... I have no errors on this though... I have to make something that will make the balls disappear if one of them goes past the paddle. What should I put here Again, I am not asking anybody who will be replying here to do this for my own sake... I am just seeking the answers...
VIEWS ON THIS POST

81

Posted on:

Monday 12th November 2012
View Replies!

Upgradation to CS6

folks. I was wondering if anyone is thinking of upgrading to Adobe CS6 or will you be waiting or skipping the release. Some of our team members are on CS4 and some on CS5, what would you suggest we do regarding CS6. Will appreciate your advice and any experiences positive or negative you may have had with CS6
VIEWS ON THIS POST

61

Posted on:

Monday 19th November 2012
View Replies!

question about constructor

, again I am new to programming. My question is, I am noticing that certain things cannot be performed in the constructor. But if you add a listener to go into another private function, and copy what you want to do from the constructor to the other function it works. Why is this I would look on the web gladly to find my answers but I am not sure what to look for. If someone could tell point me to an article about this or explain briefly that would help my code organization by quiet a bit. Thank you in ADV Also if I'm just spouting out crap and im wrong, please let me know also !
VIEWS ON THIS POST

69

Posted on:

Friday 30th November 2012
View Replies!

How To Do A Preload/loading In Flash

I'm a newbie to Flash MX (its my first flash program) and I was wondering how those neat preloading/loading flash files/pages are created. For example just a basic one like at http://www.fontsforflash.com.
VIEWS ON THIS POST

56

Posted on:

Friday 30th November 2012
View Replies!

Flash [Please HELP] flash and math displaycubes not working as planed

http://adburydire.vacau.com/exp.swf The above link will show the actual working file. I am using flashandmath displaycube class to create cubes and plastering their sides with jpegs after breaking one jpeg using an example of image shatter by Devin Reimer. If u look at the example in the link u would know the problem itself. The cubes on the lower portion of the stack are distorted. I would be very great-full if any one can provide a solution. Am attaching the files used. just include the exp.as in any fla of 800x600 dm Thank you
VIEWS ON THIS POST

59

Posted on:

Saturday 29th December 2012
View Replies!

Flash movie clip

I have a program to draw straight lines in a coordinate plane.i create a movie clip ans input ywo pints of the first line and the line is drawn.But when i input the second data of the second line, the new line is drawn but the first line disappears. Please i need your help.
VIEWS ON THIS POST

37

Posted on:

Sunday 30th December 2012
View Replies!

AS3 Day night simulator

all! So what i'm trying to create is a landscape with an actual time-based day and night background(sun, moon). This is what i have: night_mc is a layer for the darkness of the night, set on multiply and the code controls the alpha-channel. Code: stage.root.addEventListener(Event.ENTER_FRAME, renew); function renew(e:Event):void{ getTime(); } function getTime():void{ var now:Date = new Date(); var sec:Number = now.getSeconds(); if (sec > 14 && sec < 44){ night_mc.gotoAndPlay("nightoff"); }else if(sec < 45 || sec > 15){ night_mc.gotoAndPlay("night_on"); } } I'm doing it with seconds so i wont have to wait 6 hours. But the problem is that i want to have 4 stages of darkness. - sunset (little bit dark) - day (normal) - dawn (little bit dark) - night (dark) But somehow that wont work. Can somebody help me
VIEWS ON THIS POST

51

Posted on:

Sunday 30th December 2012
View Replies!

Flash Distorting sound in flash

Is it possible at all to when you import a sound from xml into flash - can you then distort the sound i.e. slow it down, speed it back up again And how would you go about it I am making a game where if you miss a hitTest then it slows down the track being played and when they starting hitting the area again the music starts to speed back up to normal.
VIEWS ON THIS POST

33

Posted on:

Sunday 30th December 2012
View Replies!

Flash cs5 AS3 Errors in IE 7 & IE 8

Hi Friends, I am having little issue in loading external swf on click. It shows error in flash TypeError: Error #1009: Cannot access a property or method of a null object reference. at Aerial_View_fla::MainTimeline/pageload() each swf has its loader code, and main movie controlls the external swf's. for your reference i have attached the fla cs4 versions im using cs5. the same errors are prompting in >ie browsers ff and ie6 wroks well. please help me.
VIEWS ON THIS POST

61

Posted on:

Monday 31st December 2012
View Replies!

get a value out of a functioin

I'm trying to load xml data and then calculate the length of a xml node and then pass that value so that it's available outside the function. I'm obviously doing it wrong also I don't understand how tlbXML is being passed to the assign() function. does this happen automatically Code: package { import flash.display.MovieClip; import flash.display.Loader; import flash.events.*; import flash.net.URLLoader; import flash.net.URLRequest; import flash.xml.*; public class Test extends MovieClip { public function Test() { var tlbXML:XML; var tlbLoader:URLLoader = new URLLoader(); tlbLoader.load(new URLRequest("tlbContent.xml")); tlbLoader.addEventListener(Event.COMPLETE, processTlbXML); function processTlbXML(e:Event):void { tlbXML = new XML(e.target.data); assign(); } var tlbNode3Length:int = 0; function assign(){ var tlbNode3:String = tlbXML.tlb.node3.toString(); tlbNode3Length = tlbNode3.length; getValue(tlbNode3Length) } function getValue(tlbNode3Length){ //this trace obvoiusly works trace(tlbNode3Length + " = tlbNode3Length inside function "); return tlbNode3Length; } //trying to pass the value of tlbNode3Length to var valueIGet var valueIGet:int = getValue(tlbNode3Length); trace(valueIGet + " = tlbNode3Length outside function "); } } } help is much appreciated
VIEWS ON THIS POST

76

Posted on:

Monday 31st December 2012
View Replies!

Physics Engine?

This is probebly aksing for to much but... Is there anyone that can write a really basic physics engine including 1 ball and 1 solid object So it should be 1 ball and then 1 solid object like a box. The box should be completly solid, the ball shouldnt be able to go trhough the box, it should just stop when hitting it at any angle. I'm new to flash and learning best by looking at exampels.
VIEWS ON THIS POST

33

Posted on:

Monday 31st December 2012
View Replies!