Issue with AS3 RSS reader


Hi

I am trying to develop a custom AS3 RSS reader. I have got to a point where I have traced the pubDate, description & title from each item of the feed. My issue is how do I then get this info to display in seperate MCs on the stage I can only display the last post in one MC rather all posts.

Here is my AS...

Code: var container_mc:MovieClip; var myTotal:Number; var myItem:XMLList; Font.registerFont(hattoriHanzo); var textBox:TextField = new TextField(); var textBox1:TextField = new TextField(); var textBox2:TextField = new TextField(); var format:TextFormat = new TextFormat(); format.size = 24; format.leading = 1; format.align = TextFormatAlign.LEFT; format.font = "Hattori Hanzo Light"; format.bold = true; format.color = 0x004964; format.letterSpacing = 2; textBox = new TextField(); textBox.defaultTextFormat = format; textBox.selectable = false; textBox.mouseEnabled = false; textBox.antiAliasType = AntiAliasType.ADVANCED; textBox.multiline = true; textBox.wordWrap = true; textBox.width = 400; textBox1 = new TextField(); textBox1.defaultTextFormat = format; textBox1.selectable = false; textBox1.mouseEnabled = false; textBox1.antiAliasType = AntiAliasType.ADVANCED; textBox1.multiline = true; textBox1.wordWrap = true; textBox1.width = 400; textBox2 = new TextField(); textBox2.defaultTextFormat = format; textBox2.selectable = false; textBox2.mouseEnabled = false; textBox2.antiAliasType = AntiAliasType.ADVANCED; textBox2.multiline = true; textBox2.wordWrap = true; textBox2.width = 400; var myXMLLoader:URLLoader = new URLLoader(); myXMLLoader.load(new URLRequest("http://www.onesg.co.uk/news/feed/")); myXMLLoader.addEventListener(Event.COMPLETE, processXML); function processXML(e:Event):void { var myXML:XML = new XML(e.target.data); myTotal = myXML.channel.item.length(); myItem = myXML.channel.item; callNews(); container(); } function callNews():void { for (var i:int = 0; i < myTotal; i++) { var myTitle = myItem[i].title; var myDate = myItem[i].pubDate; var myDesc = myItem[i].description; trace(myTitle); trace(myDate); trace(myDesc); textBox.text = myTitle; textBox1.text = myDate; textBox2.text = myDesc; } } function container():void { var container_mc = new MovieClip; container_mc.addChild(textBox); container_mc.addChild(textBox1); container_mc.addChild(textBox2); addChild(container_mc); } I hope my explanation makes sense.
Posted On: Thursday 3rd of January 2013 10:21:02 PM Total Views:  276
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




Fluid Layout EventListener issues, Timeline Code..

I could really really use some assistance cleaning up my timeline code. I have a fluid layout and use a ResizeHandler on frame 1 of my AS for all of my navigation/ backgrounds and anything else that remains constant throughout the movie. many of the MC's controlled by that initial ResizeHandler on the 1st frame control MC's that act as buttons which advance the playhead to a corresponding frame label like so. Code: import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.events.Event; import gs.TweenLite; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener (Event.RESIZE, resizeHandler); resizeHandler (null); function resizeHandler (event:Event):void { left_mc.x = 0; left_mc.y = 0; left_mc.width = stage.stageWidth; logo_mc.x = stage.stageWidth - logo_mc.width - 25; logo_mc.y = stage.stageHeight - logo_mc.height - 15; btn1_mc.x = 460; btn1_mc.y = 15; btn2_mc.x = 115; btn2_mc.y = 15; btn3_mc.x = 230; btn3_mc.y = 15; hit_1.x = 345; hit_1.y = 15; contact_mc.x = 15; contact_mc.y = 15; home_mc.x = 575; home_mc.y = 15; } contact_mc.addEventListener (MouseEvent.CLICK, emailClick); home_mc.addEventListener (MouseEvent.CLICK, homeClick); function emailClick(e:MouseEvent):void { gotoAndStop("c"); } function homeClick(e:MouseEvent):void { gotoAndStop("h"); } often on that frame I will introduce another MC that will also need to be "Fluid" within the entire layout, so the way that I have it now is I make another ResizeHandler to control that MC and its position and scale on the stage. **** The Problem ***** I often repeat this process a lot! which leaves me with many ResizeHandlers and the way I have it now is I have an addEventListener for the new handler AND depending on the frame many removeEventListener lines of code to "remove" all the other listeners that I have created on previous frames. here is an example... Code: stage.addEventListener (Event.RESIZE, resizeHandler1); stage.removeEventListener (Event.RESIZE, resizeHandler3); stage.removeEventListener (Event.RESIZE, resizeHandler2); stage.removeEventListener (Event.RESIZE, resizeHandler4); resizeHandler1 (null); function resizeHandler1 (event:Event):void { news_mc.x = stage.stageWidth / 2 - news_mc.width / 2+ 25; news_mc.y = stage.stageHeight / 2 - 250; } TweenLite.from(news_mc, 4, {alpha:0}); Stupid I know but I don't know of a better way. I would LOVE to learn one if someone is kind enough to explain it to me. I am still not custom code savvy (I keep threatening to learn but flash is just a hobby for me and I have not had the time this past year so.....) Could someone show me the proper way to code multiple "listeners, and handlers" or make one handler work throughout the entire movie on the timeline using AS3. also when the the playhead advances to a mc which has its own handler I often get this ghosting outline of a box scaling it is really quick but also really distracting to me. you can see an example of what I mean on my site when you click the "about" or "contact" buttons. http://www.shawnconvey.com
VIEWS ON THIS POST

104

Posted on:

Thursday 25th October 2012
View Replies!

xml update issue

ok so i built a nice little CMS that is all XML driven, everything working pretty smooth you can open the documents edit them same them, make new ones, and so forth. the only issue that im hitting is that it will take the app some time before it understands the xml has changed. so i built a refresh button, it removes all of the listeners nulls the two xml lists then rebuilds everything, but this will only work after sitting around for a minuet, if i refresh right after i add content or make a new file, it won't show. this isn't a huge issue since the files do eventually update, but i would like to figure out what is going on, is there some special way of clearing out an xml in flash or is it in the cache
VIEWS ON THIS POST

91

Posted on:

Thursday 25th October 2012
View Replies!

Firefox only sound issues.

I consistently have issues with the timing of my Flash sounds in Firefox. It works GREAT in IE, but terribly in FF. It's a browser wide issue; every single Flash site that has any sounds will experience ever-increasing delays before the sound plays until I restart my browser. I've seen it get up to around 5 second delays -- totally unusable. Anyone else seen this Any way to combat it as a Flash Developer (I'm kind of thinking I'm screwed, since every single site on the internet seems to experience it.)
VIEWS ON THIS POST

113

Posted on:

Thursday 25th October 2012
View Replies!

php email form tabbing issues

I Figured it out it all had to do with the tabEnabled function it was a lot more simple than I thought.... simply did not know the function to research I simply added Code: contact2_btn.tabEnabled = false; contact1_btn.tabEnabled = false; to the top of my AS and it concentrated the tabbing to the php and not the buttons. I will leave this here for others. **** Original problem which is now solved ***** I am having some issues with a php email form that I am using in my AS3 project. the form works perfect and all communication is good. however when the user is on the page and wants to tab to the next text field it jumps to one of my hyperlinks on the same page and not to the next text field down on the php form. is there any way to stop this from happening. I have tried placing the php form on a seperate layer in a seperate mc and I have done the same with the hyperlinks but all with no luck you can see what I mean by visiting this development site. (after entering go to contact) http://www.andybarnesphotography.com/dev5 any help would be greatly appreciated.
VIEWS ON THIS POST

105

Posted on:

Thursday 25th October 2012
View Replies!

Security issues on Audio Stream

I'm writing a streaming audio player in flex for a client of mine. Everything is going fine except for the security issues. I'm using computeSpectrum to draw a sound channel visualization and that function is one of the one's flash security limits without proper use of a crossdomain file. Basically its set up on two servers. www.clientswebsite.com/somedirectory/AudioPlayer.html is the page with my .swf. streamstation.clientswebsite.com is a server with shoutcast set up. I had my client install IIS on port 80 so now theres a crossdomain file at streamstation.clientswebsite.com/crossdomain.xml. The file is on the up and up: but for some reason I still get security issues poping up in my debug flash player. I am not at all a server or hardware guy, I'm a humble flash developer and this security issue has me stumped. So, I would greatly appreciate any advice you have.
VIEWS ON THIS POST

67

Posted on:

Thursday 25th October 2012
View Replies!

Flex date field issue

I am not sure if it is only me. I have try this serveral times with date field component. Here is my code: private function init():void { text1.text = dateField.selectedDate.fullYear + "/" + dateField.selectedDate.month + "/" + dateField.selectedDate.date; } ]]> after the date field closed, the text show the right YEAR and DATE, but not the right MONTH. If I choose January, the MONTH will actually becomes to ZERO. Please, could anyone tell me why! Thank you so much. Have a good festive season.
VIEWS ON THIS POST

91

Posted on:

Thursday 25th October 2012
View Replies!

Smoothing external images via xml issue

... I have this code in as3 that creates dynamic movieclips and adds images in dynamically via xml. I used code to smooth the bitmap before it is attached the the holder movie clip, but I run into an issue of it seeming to only work for the last image in the loop. It attaches and finds all the images with no problem but it seems to only apply smoothing to the last image in the loop. Can any one help me out Below is the code that I am using. var imageList:XMLList=imageInput.image.ilink.text(); var counter:Number=0; totalImages = imageList.length(); for each (var imageElement:XML in imageList) { this["holder" + counter + "_mc"] = new MovieClip(); polaroid_mc.addChild(this["holder" + counter + "_mc"]) this["holder" + counter + "_mc"].x = 29.9 this["holder" + counter + "_mc"].y = 44.5 var myBitmap:Bitmap = new Bitmap(); var bitMov:MovieClip = new MovieClip(); var URLReq:URLRequest=new URLRequest(imageInput.image.ilink.text()[counter]); var imageLoader:Loader = new Loader(); imageLoader.load(URLReq); this["holder" + counter + "_mc"].addChild(imageLoader) imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, loadBit); //this["myMovieClip"+counter].addChild(bitMov); function loadBit(event:Event):void { myBitmap=Bitmap(imageLoader.content); myBitmap.smoothing=true; } this["holder" + counter + "_mc"].alpha = 0; counter=counter+1; }
VIEWS ON THIS POST

125

Posted on:

Thursday 25th October 2012
View Replies!

bytesTotal issue with flashplayer 10 ?

Hi Kirupa Forum ( 1st post ) I made a preloader, and it work's fine in my IDE of flash CS3(fllashplayer 9 installed). But when i put it on the server, and run it my browser with FP 10 installed, it seems like the bytestTotal and bytesLoaded values are the same. They are increasing simultaneous. If i give a constant value instate of bytesTotal, it work's Has anybody the same troubles Here is my preloader which should be ok: PHP Code: //importgs.*; stage.scaleMode=StageScaleMode.NO_SCALE; stage.align=StageAlign.TOP_LEFT; varcontentLoadArea:MovieClip; varcontentLoader:Loader; varloaded:Number; //varswfPath:String="some.swf"+"d="+String(newDate().day); varswfPath:String="some.swf"; //-->LOADCONTENT contentLoader=newLoader(); //contentLoaderInfo contentLoader.load(newURLRequest(swfPath)); contentLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,contentLoading); contentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,contentLoaded); //-->LOADINGINPROGRESS functioncontentLoading(e:ProgressEvent):void{ \t\tloaded=e.currentTarget.bytesLoaded/e.currentTarget.bytesTotal; \t\t \t\tbytes_tf.text=String(e.currentTarget.bytesLoaded);\t//debugfield1 \t\ttotal_tf.text=String(e.currentTarget.bytesTotal);\t//debugfield2 \t\tprozent_mc.prozent_txt.text=String(int(loaded*100)); \t\tpreloader_mc.preloader_bar_mc.width=loaded*preloader_mc.preloader_background_mc.width; } //-->LOADINGCOMPLETE functioncontentLoaded(e:Event):void{ \t\t//sometweening \t\t//TweenLite.to(preloader_mc,1,{alpha:0,delay:0.2}); \t\t//TweenLite.to(prozent_mc,1.2,{alpha:0,delay:0.2,onComplete:endOfPreloading}); \t\tendOfPreloading(); } //-->SHOWCONTENT functionendOfPreloading():void{ \t\tcontentLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,contentLoading); \t\tcontentLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,contentLoaded); \t\t \t\tremoveChild(preloader_mc); \t\tremoveChild(prozent_mc); \t\t \t\tcontentLoadArea=MovieClip(contentLoader.content); \t\taddChild(contentLoadArea); \t\tcontentLoader=null; } stop();
VIEWS ON THIS POST

165

Posted on:

Thursday 25th October 2012
View Replies!

as3 physics issue

! The thing is i'm trying to make an effect that emmulates hanging interactive objects so that when the user hits any object it moves according to the mouse position and speed. My problem is that i cant find the way to apply the tension and the "pendulum" kind of movement so it looks natural. any thoughts thanx alot!
VIEWS ON THIS POST

121

Posted on:

Thursday 25th October 2012
View Replies!

hitTest issue

Ok here is the deal: I made 3 objects and assigned a tween for each one, like so PHP Code: varredTween:Tween=newTween(newRed,"y",Strong.easeOut,500,10,GetRandomRange(10,18),true); vargreenTween:Tween=newTween(newGreen,"y",Strong.easeOut,500,10,GetRandomRange(10,15),true); varbadTween:Tween=newTween(newBad,"y",Strong.easeOut,500,10,GetRandomRange(10,17),true); and then after assigning the x value to 100 for all 3 objects i added this code PHP Code: if(newBad.hitTestObject(newRed)){ \t\t\t\tremoveChild(newRed); }elseif(newBad.hitTestObject(newGreen)){ \t\t\t\tremoveChild(newGreen); } and for some reason it is not removing the objects if they hit eachother. any help is appreciated
VIEWS ON THIS POST

84

Posted on:

Thursday 25th October 2012
View Replies!

getHours and EventListener issue.

I `m trying to get time from user`s PC to see if it`s day or night. the following code WORKS perfectly when I preview within flash. BUT it only UPDATE TIME ONCE when I viewed in a web browser. AND it updates only when I clear browser`s cash. Code: stage.root.addEventListener(Event.ENTER_FRAME, renew); function renew(e:Event):void{ getTime(); } function getTime():void{ var now:Date = new Date(); var hour:Number = now.getHours(); if (hour > 6 && hour < 18){ trace("NOW IS DAY"); // do something }else if(hour < 8 || hour > 18){ trace("NOW IS NIGH"); // do something }else{ trace("ERROR"); } } What do I need to do can anybody help me Thank you.
VIEWS ON THIS POST

76

Posted on:

Thursday 25th October 2012
View Replies!

getHours flash Cache issue AS3.0

hello, I am trying to get time from user`s PC, and change contents depending on if it`s day or night. the following code works perfectly when I preview within flash. it updates everthing when an event occurs. BUT it only works first time when I open it from HTML, unless I clear browser`s cash. Code: var nowStat:String; stage.root.addEventListener(Event.ADDED, getTime); function getTime(e:Event):void { var hour:Number = now.getHours(); if (hour > 6 && hour < 18){ nowStat = "day"; trace(nowStat); }else { nowStat = "night"; trace(nowStat); } } can anybody help me P.S. I`m using AS 3.0 Thank you.
VIEWS ON THIS POST

183

Posted on:

Thursday 25th October 2012
View Replies!

Flex Multiple netstream issue with FMS3 & Flex3

I am facing a problem to create (publish/play) multiple Net streams. Its a multiuser chat and video conferencing application. When, I am testing application, with 3-4 members (whose are playing approx 16 - 18 streams and publishing 4). I am getting issues like: 1. Stream is publishing stops for a particular user. 2. Stream is closing for a particular user 3. streams are closing for a particular user 4. Stream is publishing only for 1 sec for new user. 5. Breaking Netconnections. 6. Stream is closing after some time (even now event is triggered, no user come, no clicked on anything, happening just like that) Observations are: 1. These issues are not regular; it comes some time (like out of 10/7 times) 2. Generally coming on entry of new user in FMS. 3. Not to a particular user, any user is facing this. 4. Not a particular time or event. Platform & Softwares Using. OS: Microsoft windows XP with SP2 IDE: Flexbuilder 3 Rendering server: Flex 3 Script lauguage: Actionscript 3 (Some MXML for UI design, otherwise all code in AS3 classes). FMS: Flash media interactive server (Licenced version) (already tested with 2-3 defferent servers) (FMS installed on Linux) Testing browser: IE 7/6 Note: In my application, there is two different netConnections. One is for user list and chatting and one only for streams ( streams are in one room). Please let me know if any expert has any idea about this or how to fix this.
VIEWS ON THIS POST

84

Posted on:

Thursday 25th October 2012
View Replies!

flash unload problem - memory issue

I am using the loader class to load an swf into a container. That seems pretty basic, but it's creating this huge memory usage in the browser. In other words, my swfs are not getting unloaded. And, the more that load, the bigger the memory usage gets. It's my understanding that I need to get rid of the loader, remove child, and null it. But, I can't seem to figure this out. Any help is greatly appreciated. // load Home Movie into container on stage var loader:Loader = new Loader(); var request:URLRequest = new URLRequest(nextMovie + ".swf"); loader.load(request); container.addChild(loader); btn1.gotoAndStop("on"); // this function is called at the closing of the clip that is active. it is called from the timeline of the active clip, it's last frame. function movieLoad(){ var loader:Loader = new Loader(); var request:URLRequest = new URLRequest(nextMovie + ".swf"); loader.load(request); container.addChild(loader); }
VIEWS ON THIS POST

199

Posted on:

Thursday 25th October 2012
View Replies!

OS X only bug... addChild issue?

I'm having a REALLY frustrating issue, where an item refuses to show up - but it only happens on Mac OS X in Firefox and Safari. I can't post the file, but here is what I know: 1. It is not an embedding issue. 2. It is not a font issue. 3. The class has been instantiated and is present - it just is visually not on the stage or clickable. I am completely baffled. Can anyone thing of OS X only bugs that would cause this It works perfectly on PC, and in Opera on OS X. Solution: I wiggled it. Yeah. Seriously. I moved it one pixel forward, and one pixel back, and voila. This was definitely a bug in the Mac player. Oh, and I Sekasi. Geez. Stupid bug.
VIEWS ON THIS POST

59

Posted on:

Thursday 25th October 2012
View Replies!

Google Analytics: Track/on release issue?

Google Analytics was able to track the "clicked" ads with html and track js, but it couldn't track the "clicked" ads coming from swf. I use xml file to load data into swf and it appears successfully load everything except track. Is this on release code wrong: Code: box.on (release) { //Track with action getURL("javascript:pageTracker._trackPageview(trackad[p]);"); getURL(link[p], "_blank"); appreciate any help in advance! Friggin' Mick
VIEWS ON THIS POST

65

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

62

Posted on:

Thursday 25th October 2012
View Replies!

better way for this Loader and issue

I am fairly new to AS3 but here is my code Code: function attach(p:XML) { var plist:XMLList = p.project; numOfItems = plist.length(); //trace(numOfItems); for (var i = 0; i < numOfItems; i++) { var t = new item(); t.name = "item_"+i; t.addEventListener(Event.ENTER_FRAME, render); t.tooltext = plist.name[i].text(); var pictLdr:Loader = new Loader(); pictLdr.load(new URLRequest(plist.thumb[i].text())) t.icon.inner.addChild(pictLdr); t.r.inner.addChild(pictLdr); addChild(t); } } The issue is with the loader.. what would be the most efficient way of doing this.. i have a feeling there is more efficient way of doing the loader... issue #2 - using this method the picLdr will only addChild to the last one t.r.inner.. and not the first one.. if i remove the t.r.inner it will load it to the icon one. i need to load it to both.
VIEWS ON THIS POST

62

Posted on:

Thursday 25th October 2012
View Replies!

ContextMenu issue

, I've built myself a working ContextMenu, which when tested in the Flash IDE works perfectly fine, and when tested in a browser (as the swf file). However, when loading it in through SWFObject and some PHP the context menu no longer has custom items. Any thoughts
VIEWS ON THIS POST

62

Posted on:

Thursday 25th October 2012
View Replies!

odd rotation issue

My issue is that I have a ball in my game, and as it rolls along the ground it rotates. The physics were acting a little wonky, and then I realized that even though the ball MovieClip is just a circle, the shape of the MC itself is actually a square! Does anybody know if there's an easy fix for this I hope I explained this well enough.
VIEWS ON THIS POST

61

Posted on:

Thursday 25th October 2012
View Replies!

3d Flip Effect

, I am trying to get the same effect that I saw on SOBE's website. It is a card that flips around then expands to be the background. from this link (http://sobe.com/#/tryeverything/), you can click on the cards labeld: "Try milking the cow" or "Try kissing the office hottie" I was wondering if anyone had any suggestions on where to start. Do you think I should user papervision or can this be accomplished without 3d api Thank you.
VIEWS ON THIS POST

54

Posted on:

Monday 29th October 2012
View Replies!

Accessing Loop Variables Outwith Loop

Say, I had a loop in a function... Code: function startLoop(event:Event):void{ for (var a = 0; a < 5; a++){ } } ...How would I refer to a in another function
VIEWS ON THIS POST

34

Posted on:

Monday 29th October 2012
View Replies!

Flash Space Games

hi ...well, i'm trying to make a space game much like space invaders...in my game i have a panel on the bottom of my screen which displays the health bar and equipment of my player...now my problem is when the enemies are going down..it goes over the panel at the bottom of the screen...how can i restrict the movement of the enemies by making it disappear before it to the panel at the bottom of my screen\t\t thx)
VIEWS ON THIS POST

40

Posted on:

Monday 29th October 2012
View Replies!

Flex I want to stay in the current page in .swf file after pressing F5

Hi i've embeded my swf file in .net application and after navigating to some pages in swf file and pressing f5 or refresh, its navigating to starting page of swf file and browsers path always shows the same path (main.aspx page) in which i am embedding the swf file. after navigating to some pages in swf file also it shows the sam path. So its refreshing the aspx page and giving the starting page. How can i control the browser to stay in current page of swf file.
VIEWS ON THIS POST

81

Posted on:

Monday 29th October 2012
View Replies!

Need help displaying variables in final screen

Hi i have made a small flash game (my first). Its a simple shotting style game and I want to display 3 variables at the end. The variables calculate fine but I am unable to display them in the end screen. Can someone guide me how to do this. I have uploaded the fla file I have created. If someone is kind enough to add a few lines of code my email address is mittal_oxford@yahoo.co.uk
VIEWS ON THIS POST

114

Posted on:

Monday 29th October 2012
View Replies!

trouble with loading external images and swfs into flash movie

all. I'm putting together a flash portfolio of some of my graphic art and I'm having a problem with the loader. Each time I load a JPG, SWF, (or anything for that matter) Flash scales them up and out of their native resolution. The result is really bad looking images and animations. For example, when I load a 450 x 350 pixel swf into my portfolio and add it to the stage, Flash enlarges it by about 30% or so. Nonetheless, when I trace the loader.width of said swf, Flash tells me that it is 450 pixels - the correct size. Has anyone experienced this before I'm really baffled!
VIEWS ON THIS POST

135

Posted on:

Monday 29th October 2012
View Replies!

Flash send data to xml and update it without php code [question]

hi, I want to know if I can send data to xml and update it without php code, using only action script or Air code
VIEWS ON THIS POST

81

Posted on:

Monday 29th October 2012
View Replies!

problem with netStream.bufferTime and netStream.time

I'm playing a recorded video from Flash Media Server and when I increase the bufferTime of my netStream object (to ensure video plays smoothly), it causes the video to skip a few seconds when it starts playing. When I decrease buffertime to 0 or near 0, video plays right from the start but with a bufferTime of a few seconds there is a jump when video starts. The jump in video is relative to the value of bufferTime, that is the larger the bufferTime value, the more seconds are missed when video starts playing. Is this a bug in FMS or I'm doing something wrong
VIEWS ON THIS POST

74

Posted on:

Monday 29th October 2012
View Replies!

code rage

I just came across this little gem in the header comments of a third-party wrapper class someone wrote in order to make a certain ad service's own API functional. I figured I'd share the love, though I removed the name of the offender company in order to protect the "innocent". The asterisks to mask profanity were added by this forum, of course. /** * Dear ######, * * YOU HAVE THE WORST ****ING DOCUMENTATION I HAVE EVER SEEN IN MY ENTIRE LIFE. * I thought it was bad when DoubleClick had references to magic numbers in * their documentation that werent posted anywhere public, but youve managed * to one-up them and create a completely indecipherable mess. I cant tell * you the sorts of splitting headaches I got trying to make sense of this * utter trash, and thats especially damning because it contains about as much * information as Die Hard contains plot. * * When you write your API documentation, do not do so by giving a sample * implementation to a brainless technical writer that does not know the * language at hand and then allow them to bulk it up with useless comments * like The first line sets the parent MovieClip equal to the root * MovieClip. HOLY ****, THATS WHAT THE = OPERATOR DOES! I THOUGHT IT MADE * RAINBOWS COME OUT OF MY BUTT. THANK YOU SO MUCH FOR CLEARING THAT UP FOR * ME. * * Also, including AS2 and AS3 reference in the same document might have saved * you a little bit of time not having to maintain two separate files, but * it just confuses the hell out of things when you decide to complete the * AS2 parts but leave the AS3 parts half-finished. Oh, and when you fail to * document things like THE error_string PROPERTY, which I had to call * flash.utils.describeType in order to find, and instead document things like * the ######_start_time property WHICH DOES NOT EXIST ANYWHERE IN YOUR * LIBRARY, or the update_interval property WHICH DOES ABSOLUTELY NOTHING. * * For extremely loose definitions of the term complete. Assigning 20 * variables directly from FlashVars without describing anything else about * what they are supposed to contain is hardly complete, but its far better * than writing one line of code followed by an ellipsis, which is what you * did for AS3. * * It seems that at least one person there knew how useless the main SDK * documentation was, because also included in the SDK package was * play_as3_interface2.txt which somehow manages to be infinitely more useful * despite being 17 pages shorter. Of course, even that one slightly less dim * bulb failed to notice that it too gives examples of what is valid input for * a property BY REFERENCING UNDEFINED VARIABLES. In the end, Ive had to * resort to reading disassembled bytecode multiple times simply because all * the official documentation is about as useful as a two-year-old. * * Of course, none of this ultimately matters all that much because good * documentation cant save an API written by a bunch of mouthbreather MBAs * that decided to completely ignore Flashs standard method and property * naming conventions and instead assembled the worst jumble of incompatible, * inconsistent, and unintuitive methods and property names imaginable. * Nothing says professional and well-designed like 3 different naming * conventions all rolled into a single API! Also, thanks very much for not * providing an unstripped debug version, but instead liberally adding trace * calls that bloat the production library for no good reason. Getting my * output console flooded with NetStream data is INCREDIBLY useful when Im * trying to figure out why the ad_playing event isnt working the way the * documentation says it is supposed to. (And, as always, the answer turned out * to be the documentation is wrong. Shocking.) * * And now we come to the JavaScript API. Completely undocumented (so you dont * even really know its there at first, save for some very brief utterances of * the term ExternalInterface), this stellar collection of anti-patterns * creates unprefixed functions directly in the global page namespace through * eval() and follows up by using a single callback function to perform a * seemingly infinite array of arbitrary tasks (complete with arbitrary, * worthless arguments). It honestly probably would have been better if you * hadnt tried to add JavaScript support in the first place, since I am pretty * sure that performing surgery with a rusty spoon would be easier and more * pleasant than working with this callback system. * * P.S. Why the **** are there 12 undocumented public properties and * 39 undocumented public methods in your library Either ****ing document them * or seal up your ******* classes properly, you worthless hacks. */
VIEWS ON THIS POST

43

Posted on:

Monday 29th October 2012
View Replies!

Task: Populating a tree from a list control with XML dataprovider

I have an XML file which is used by a combobox and two list boxes. The user selects the value they want from the combobox, which then populates the first list box. They then click the value in the list which populates the second listbox. From there I have created a button so the user can add their selection to a tree control in order to display all the values they have selected. Does anyone know how to create parent and children nodes in a tree control using a listcontrol.selectedItem where the selected item is an XML value I'd love some help with this one, so if you're able to assist please let me know and I can send through more info.
VIEWS ON THIS POST

66

Posted on:

Sunday 25th November 2012
View Replies!

Import SWF file to stage via actionscript

Does anyone know if you can perform the "import swf to stage" action in actionscript 2 or 3\t Prefereably AS3. I have no idea is this is possible and cant find anything on the net relating to it. Basically i want to import a swf file in to a time line, so for example, i have a OCR reader that zips uploading into a .tif file. The tif file is then converted to swf and then i want to import it to flash so people can read it like a book, zoom in on scans etc. Let me know THanks a bunch
VIEWS ON THIS POST

55

Posted on:

Friday 30th November 2012
View Replies!

Colour Mixer

When you have a object, you click it and it it has the white spots etc, you then can change the colour by going to the colour mixer, if you select Linear, the white part goes to the right hand side, how do you change it so that the white part goes to the top instead
VIEWS ON THIS POST

76

Posted on:

Friday 30th November 2012
View Replies!

using php in flash

yeah i wont to know if it possible
VIEWS ON THIS POST

103

Posted on:

Friday 30th November 2012
View Replies!

Lottery balls floating, bouncing

Trying to wrap my mind around how lottery balls fly around in those air bubbles. They are pushed up and around I assume, and they bounce off each other and the round sides of the container. I have been searching for examples but only found a Stringy example from 2005 http://www.kirupa.com/forum/showthre...ttery+balls%22 Code: var r=circle._width/2 for (var i = 0; ir-this._width/2){ this.velx*=-1 this.vely*=-1 } }
VIEWS ON THIS POST

46

Posted on:

Sunday 30th December 2012
View Replies!

Help with Bullet ricochet!

Ok i made a tank that can move and shoot but i want the bullet to bounce or "ricochet" off the walls so i gave it a shot but.. the bullet bounces off the wall but after i shoot a couple they all suddenly are in sync heres my code.. PHP Code: functionmouseDown(pEvent){\t\tif(amo>=1)\t\t{\t\t\t\tvarb=newBullet();\t\t\t\tb.x=myTank.x;\t\t\t\tb.y=myTank.y;\t\t\t\tamo-=\t1;\t\t\t\tb.angleRadian=Math.atan2(mouseY-myTank.y,mouseX-myTank.x);\t\t\t\tb.addEventListener(Event.ENTER_FRAME,bulletEnterFrame);\t\t\t\taddChild(b);\t\t}}functionbulletEnterFrame(pEvent){\t\t\t\tvarb=pEvent.currentTarget;\t\tb.x+=\tMath.cos(b.angleRadian)*speed;\t\tb.y+=\tMath.sin(b.angleRadian)*speed;\t\tb.rotation=b.angleRadian*180/Math.PI;\t\tif(b.y
VIEWS ON THIS POST

78

Posted on:

Sunday 30th December 2012
View Replies!

RSL Problem

Hi. This is driving me crazy : I have a preloader.swf and index.swf files. the things works great in my computer. But in some computers and browsers when the loading is completed , index.swf doesn't play and just shows the default loading of flash. ( few dots animating ). I emphasis that I can see the website proberly and complete in my computer ( online and offline ). Just in some computers, this problem happens. I even checked that they have flash player 10 installed. When I set the default linkage in as 3.0 settings to merge into code, everything will go ok but the size of my file goes nearly 100Kb higher. Does anybody ever had my problem
VIEWS ON THIS POST

75

Posted on:

Thursday 3rd January 2013
View Replies!

Google Map AS3 error. 1046

http://www.kirupa.com/developer/as3/flash_as3_google_maps_api_pg2.htm 1046: Type was not found or was not a compile-time constant: DirectionsEvent. I highlighted the line with error in RED. The code is as follows: import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; import com.google.maps.InfoWindowOptions; import com.google.maps.LatLngBounds; import com.google.maps.MapMoveEvent; import com.google.maps.overlays.Marker; import com.google.maps.overlays.MarkerOptions; import com.google.maps.interfaces.IPolyline; import com.google.maps.services.*; var dirirections; var polyline:IPolyline; var map:Map function setupMap() { map = new Map(); map.key="ABQIAAAAh8LfxQ8YLf1biQWzuFIxzxQSOn345XElU GjUlW3_TRSFT8fI1BSxauGJGfMCQCKzhMONHnGM-4nk1Q"; map.setSize(new Point(400,400)); map.x=0; map.y=0; map.addEventListener(MapEvent.MAP_READY, onMapReady); this.addChild(map); } setupMap(); function onMapReady(event:Event):void { dir = new Directions(); dir.addEventListener(DirectionsEvent.DIRECTIONS_SU CCESS,onDirectionsLoaded); dir.load("121 Kings Road, Westampton, NJ to 300 Mill Street, Bristol, PA"); } function onDirectionsLoaded(eventirectionsEvent):void { var returnedDirectionirections=event.directions; var startLatLng:LatLng=returnedDirection.getRoute(0).g etStep(0).latLng; var endLatLng:LatLng=returnedDirection.getRoute(return edDirection.numRoutes- 1).endLatLng; polyline=returnedDirection.createPolyline(); map.clearOverlays(); map.addOverlay(polyline); map.addOverlay(new Marker(startLatLng)); map.addOverlay(new Marker(endLatLng)); map.setCenter(returnedDirection.bounds.getCenter() , map.getBoundsZoomLevel(returnedDirection.bounds)); } ----- I changed the Google API Key and the address that were in the code found on this site. is there an easy fix for this
VIEWS ON THIS POST

49

Posted on:

Thursday 3rd January 2013
View Replies!

Resize handler randomly works?!

Hi all. I have a main swf which I load in a few different external swf. For each of the external swf I have resize handlers which make sure my loaded swf are position in the correct place when window is resized. It works almost perfect.. but let say 1 out of 4 times the resize handler stops and nothing happens. Why does it sometimes work only I know I should not have function within a function but in this case I do not know how to do it in any other way! I have attached the code for one of the functions: Thankful for all advice. Code: function eventsLoaded(event:Event):void { mcExt = MovieClip(contentLoader.contentLoaderInfo.content) loadedMovieClip="events"; preloader_mc.visible = false; this.stage.addEventListener(Event.RESIZE, resizeEvent, false,0,true); eventsBG_mc.width = stage.stageWidth; eventsBG_mc.height=stage.stageHeight; eventsBG_mc.x=stage.stageWidth; contentLoader.x=stage.stageWidth; contentLoader.y=stage.stageHeight/2-contentLoader.height/2; addChild(eventsBG_mc); addChild(contentLoader); var timeline:TimelineLite = new TimelineLite(); timeline.append( new TweenLite(contentLoader, 1, {x:305, ease:Sine.easeOut}) ); timeline.append( new TweenLite(eventsBG_mc, 1, {x:305, delay:-1, ease:Sine.easeOut}) ); //resize handler function resizeEvent(){ eventsBG_mc.height=stage.stageHeight; contentLoader.y=stage.stageHeight/2- contentLoader.height/2; } }
VIEWS ON THIS POST

296

Posted on:

Thursday 3rd January 2013
View Replies!