Search Amazon.com:
Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«37 »
  • Post
  • Reply
Sindow
Dec 13, 2004

Everyday I'm shufflin'.

Air also provides access to native executables (you can run exe files and whatever OSX uses) and can use system menus instead of having to program your own. Air has a built in updating system as well so you can push updates without needing users to keep on checking a website or whatever.

By the way, if you use Alchemy in any of your projects be warned that Adobe is no longer supporting the prototype Alchemy build if your project targets Air 3.x or Flash 11. You will have to target Flash 10/Air 2.x

Adbot
ADBOT LOVES YOU

runupon cracker
Jan 13, 2006

This will hurt me more than it hurts you.

I have a bit of a love/hate relationship with AIR right at the moment. I'm doing AIR for iOS/Android dev, and while AIR certainly makes some things easier, the performance and memory management is absolute dogshit.

Sindow
Dec 13, 2004

Everyday I'm shufflin'.

Yeah. Native apps are almost as easy to make and perform way, way better. I don't know why Adobe is putting so much time into Air Mobile.

thegasman2000
Feb 12, 2005

Moneyspider Design


Vlad the Retailer posted:

I'll take a look at it - no promises, though.

Cheers dude,

Simple question regarding loading an image through RSS.

I have loaded the RSS as an XML and can display the current post title, description and pub date fine. The issue is when I try and load an image. I have added UILoader but dont understand the RSS element. I presume I want this element.
code:

<enclosure type="Image(84)" url="http://images.planetf1.com/12/02/84/Lewis-Hamilton_2715987.jpg" content="http://images.planetf1.com/12/02/84/Lewis-Hamilton_2715987.jpg"/>
</item>

what code do I use to pull that out? I have tried
code:
function displayPost():void
{
	title.text=myXML.channel.item[currentPost].title;
	description.text=myXML.channel.item[currentPost].description;
	UILoader.source=myXML.channel.item[currentPost].enclosure.content;
	pubDate.text=myXML.channel.item[currentPost].pubDate;
}
and the others work but the UILoader doesn't

Suspicious Dish
Sep 24, 2011



Attributes are accessed with an attribute-qualified name:

code:
UILoader.source=myXML.channel.item[currentPost].enclosure.@content;
Try that.

Sindow
Dec 13, 2004

Everyday I'm shufflin'.

Or you may have to cast the element into a string.

UILoader.source = String(myXML.channel.item[currentPost].enclosure.content);

I think getting an XML element by doing xml.child technically returns XMLList. If the UILoader thing is checking whether the variable assigned to source is a String or not it may fail for that reason.


e: Actually no I missed that you were getting an attribute, not a child of a node. You do need to use @content. What I said above may still apply though so I'll keep it up.

thegasman2000
Feb 12, 2005

Moneyspider Design


Suspicious Dish posted:

Attributes are accessed with an attribute-qualified name:

code:
UILoader.source=myXML.channel.item[currentPost].enclosure.@content;
Try that.

Thanks so much! I googled for all sorts and couldn't even put into words what I meant. That worked great and now I can make some actually useful apps. Sindow thats for bothering to reply I love SA.

thegasman2000
Feb 12, 2005

Moneyspider Design


next question....

I am loading an rss feed from twitter... The problem is the random images in the description and title tags are just showing as plain text. Can I make an if statement which does a find and cut feature to load the url as an image?

I also have the problem that I have several RSS feeds combined through yahoo pipes and some have images, the code above worked great, but some dont and they error. Again do I need an if statement that is @content exists do this else... ?

runupon cracker
Jan 13, 2006

This will hurt me more than it hurts you.

So we've just published our first AIR app to the iTunes App Store, and to our horror the languages are listed as English, Chinese, Czech, etc. Yeah, it's only English. But we only added an English localization for the app metadata, and for the life of me I can't find anywhere else to explicitly state which languages are available in the app. Halp?

edit: well now: http://forums.adobe.com/message/3976641#3976641

gently caress Adobe. Seriously. gently caress them, right in the rear end.

runupon cracker fucked around with this message at Feb 29, 2012 around 11:21

thegasman2000
Feb 12, 2005

Moneyspider Design


Small question... How can I change a strings value using math?

I have a string from the geolocation which returns speed in Meters per Second. I want to convert this to MPH (just multiply by 2.23693629) but cant work out how to multiply a string. Code looks like this:

code:
function fl_UpdateGeolocation(event:GeolocationEvent):void
		{
			speedTxt.text = event.speed.toString();
		}

I tried

code:


function fl_UpdateGeolocation(event:GeolocationEvent):void
		{
			speedTxt.text = (event.speed.toString()*2.23693629);
		}
but no dice.. Any ideas? Do I need a secondary variable?

willemw
Sep 30, 2006
very much so

Think about what you're doing
code:
speedTxt.text = (event.speed.toString()*2.23693629);
you make sure event.speed is a String and then try to multiply it. Clearly that won't work.

Instead of casting it to a string, you should cast it to something you can multiply, like a Number or an int. After you multiplied it, you can cast it back to a string to put it in text. Without a secondary variable even:
code:
speedTxt.text = String(Number(event.speed)*2.23693629);

Suspicious Dish
Sep 24, 2011



GeolocationEvent.speed is already a number, so really:

code:
var speed:Number = event.speed;
var mph:Number = speed * 2.23693629;
speedTxt.text = mph.toString();
EDIT: VVV ugh.

Suspicious Dish fucked around with this message at Mar 4, 2012 around 00:19

brian
Sep 11, 2001
I obtained this title through beard tax.

Well considering you didn't multiply the speed by the mph I don't think that's gonna work bro. Plus for some reason you're assigning the number to a number variable for no reason given that you just said it's already a number.

code:
speedTxt.text = (event.speed * 2.23693629).toString();
Or doing it like willem did is fine.

Also it really doesn't help to get super pedantic about this stuff which is ironic given this post.

thegasman2000
Feb 12, 2005

Moneyspider Design


brian posted:

Well considering you didn't multiply the speed by the mph I don't think that's gonna work bro. Plus for some reason you're assigning the number to a number variable for no reason given that you just said it's already a number.

code:
speedTxt.text = (event.speed * 2.23693629).toString();
Or doing it like willem did is fine.

Also it really doesn't help to get super pedantic about this stuff which is ironic given this post.

Thanks for that. I knew I was being a tard but I am still new to AS3.

One more thing. I have followed a tutorial and they use an external AS file and for some pretty complex reasons I want to make the code work in the timeline. The original code is:
code:

package {
	
	import flash.display.MovieClip;
	import flash.media.Camera;
	import flash.media.Video;
	
	public class Main extends MovieClip {
		
		private var camera:Camera;
		private var video :Video;
		
		public function Main() {
			if(Camera.names.length > 0)
			{
				camera = Camera.getCamera("1");
				camera.setMode(stage.stageWidth, stage.stageHeight, stage.frameRate);
				
				video = new Video(camera.width, camera.height);
				video.attachCamera(camera);
				
				addChild(video);
			}
		}
	}
}
I have tried to adapt it but it but it doesn't load the camera. It doesn't error whatsoever so I suspect the issue is with the addChild(video); line which I have no clue about. Here is my code.

code:
import flash.display.MovieClip;
import flash.media.Camera;
import flash.media.Video;
// Variables for load Camera		
var camera:Camera;
var video :Video;
		
function loadCamera() {
		if(Camera.names.length > 0)
		{
			camera = Camera.getCamera("1");
			camera.setMode(stage.stageWidth, stage.stageHeight, stage.frameRate);
			video = new Video(camera.width, camera.height);
			video.attachCamera(camera);
				
			addChild(video);
					   }
		}

Fano
Oct 20, 2010


thegasman2000 posted:

One more thing. I have followed a tutorial and they use an external AS file and for some pretty complex reasons I want to make the code work in the timeline. The original code is:
code:

package {
	
	import flash.display.MovieClip;
	import flash.media.Camera;
	import flash.media.Video;
	
	public class Main extends MovieClip {
		
		private var camera:Camera;
		private var video :Video;
		
		public function Main() {
			if(Camera.names.length > 0)
			{
				camera = Camera.getCamera("1");
				camera.setMode(stage.stageWidth, stage.stageHeight, stage.frameRate);
				
				video = new Video(camera.width, camera.height);
				video.attachCamera(camera);
				
				addChild(video);
			}
		}
	}
}
I have tried to adapt it but it but it doesn't load the camera. It doesn't error whatsoever so I suspect the issue is with the addChild(video); line which I have no clue about. Here is my code.

code:
import flash.display.MovieClip;
import flash.media.Camera;
import flash.media.Video;
// Variables for load Camera		
var camera:Camera;
var video :Video;
		
function loadCamera() {
		if(Camera.names.length > 0)
		{
			camera = Camera.getCamera("1");
			camera.setMode(stage.stageWidth, stage.stageHeight, stage.frameRate);
			video = new Video(camera.width, camera.height);
			video.attachCamera(camera);
				
			addChild(video);
					   }
		}

you're declaring everything correctly but you're not calling the function at the very end:

code:
import flash.display.MovieClip;
import flash.media.Camera;
import flash.media.Video;

// Variables for load Camera		
var camera:Camera;
var video :Video;
		
function loadCamera() {
		if(Camera.names.length > 0)
		{
			camera = Camera.getCamera("1");
			camera.setMode(stage.stageWidth, stage.stageHeight, stage.frameRate);
			video = new Video(camera.width, camera.height);
			video.attachCamera(camera);
				
			addChild(video);
		}
}

loadCamera();
At least I think that's the problem, I haven't worked on the actual timeline in a long time.

thegasman2000
Feb 12, 2005

Moneyspider Design


Fano posted:

you're declaring everything correctly but you're not calling the function at the very end:

code:

loadCamera();
At least I think that's the problem, I haven't worked on the actual timeline in a long time.

Amazing Thanks! I owe you a beer. I have just learnt so much by trial and error and this helped loads.

wwb
Aug 17, 2004


I'm not a flash developer, but sometimes I get to work with them. In this case, I've got a rather green outfit who is trying to build a game. The game part looks good but I about shat myself when I saw their user management code. It struck me I'm not the first guy who has had this problem. Problem being in simple terms needing a way to reasonably securely login from the flash front-end to an ASP.NET back-end. SSL through and through is an option. Auth will probably be home rolled if that matters, some funny requirements preclude the standard options.

Disco De Soto
Aug 24, 2004

Go Go Disco!

Ok so I'm making a stupid game, which is drat close to being finished, but now i'm getting a weird problem.

I have 2 teams that fight, and team 1 works perfectly. But when I add the final code for team 2, the output swf just plays through the whole timeline without stopping, like there's an error, but there are no error messages coming up.

It's like flash is saying "Too much code bro!" and just giving me the finger. Is there some sort of limit to how much code you can add, or how many else if statements you can use? Otherwise I'm not sure what the hell the problem is, other than my lovely coding skills. Anyone have any ideas how I could figure this out?


EDIT: I'm adding the team 2 code one small piece at a time, and it seems to be working so far, but it will take me a looong time to add it all. Is there some problem with flash if you paste too much code at once?

Disco De Soto fucked around with this message at Apr 3, 2012 around 15:11

Sindow
Dec 13, 2004

Everyday I'm shufflin'.

Flash movies will do that when there is some kind of error with the code. You haven't been getting any error messages? Have you tried doing a debug run of the game?

e: Sorry, missed that one line about where there are no errors. I have had some problems before where the AS3 doesn't correctly compile even with no errors and that's usually due to a corrupt Flash file.

Sindow fucked around with this message at Apr 4, 2012 around 01:43

willemw
Sep 30, 2006
very much so

How much code are we talking about? Is it as3 or as2? I suppose it's on the timeline, not in seperate .as files?

There are some limitations http://helpx.adobe.com/flash/kb/fla...imit-flash.html (this is for cs4)

Suspicious Dish
Sep 24, 2011



willemw posted:

How much code are we talking about? Is it as3 or as2? I suppose it's on the timeline, not in seperate .as files?

There are some limitations http://helpx.adobe.com/flash/kb/fla...imit-flash.html (this is for cs4)

These limits are for AS1/AS2.

For AS3, ASC has no limit on how large a compilation unit can be, and the "12 bytes minimum per variable" is a complete lie -- local variables are tagged 32-bit values, which are often JITed into registers or stored on the stack.

Disco De Soto
Aug 24, 2004

Go Go Disco!

I'm using AS3, and the code is mostly on the timeline. But it is quite a lot of code, since I'm using this as a learning process and I still rely on long 'else if' chains.

How do I do debug run of the game? If it is a corrupt file, can I just copy paste everything to a new file?

Suspicious Dish
Sep 24, 2011



Disco De Soto posted:

I'm using AS3, and the code is mostly on the timeline. But it is quite a lot of code, since I'm using this as a learning process and I still rely on long 'else if' chains.

How do I do debug run of the game? If it is a corrupt file, can I just copy paste everything to a new file?

Most likely you have an error somewhere in your ActionScript code. Flash's parsing of ASC's error output is fragile and doesn't work sometimes. Your best bet is to just remove/comment out code until things work again.

But note that if you're copying/pasting a lot of code, you should really sit down and refactor this. Use functions and classes more.

Disco De Soto
Aug 24, 2004

Go Go Disco!

Suspicious Dish posted:

But note that if you're copying/pasting a lot of code, you should really sit down and refactor this. Use functions and classes more.

Good advice! I went back through and realised I was unnecessarily doubling or tripling up on the functions I was using.

This whole thing has been a drat good learning experience. When I figured out how out use classes it made my life a lot easier.

Disco De Soto fucked around with this message at Apr 4, 2012 around 09:39

Zeether
Aug 26, 2011


This might be a very simple thing to solve...I have a photo gallery application made that uses sounds and I want to utilize a mute button for the sounds. The sounds are being pulled from the library in the project file. Here's the code I tried for the mute button (labeled as "mutesnd"):

code:
mutesnd.buttonMode=true;
mutesnd.mouseChildren=true;
mutesnd.addEventListener(MouseEvent.CLICK, buttonmute)
function buttonmute(e:MouseEvent){
	mutesnd.stopAllSounds;
}
It doesn't work, though. Am I doing something wrong?

Fano
Oct 20, 2010


Zeether posted:

This might be a very simple thing to solve...I have a photo gallery application made that uses sounds and I want to utilize a mute button for the sounds. The sounds are being pulled from the library in the project file. Here's the code I tried for the mute button (labeled as "mutesnd"):

code:
mutesnd.buttonMode=true;
mutesnd.mouseChildren=true;
mutesnd.addEventListener(MouseEvent.CLICK, buttonmute)
function buttonmute(e:MouseEvent){
	mutesnd.stopAllSounds;
}
It doesn't work, though. Am I doing something wrong?

Function calls need to include open and close parentheses whether or not you pass in arguments to the function, try:
code:
mutesnd.stopAllSounds();
Instead of what you have...this is assuming stopAllSounds is a function of the mutesnd object, but I don't exactly know how you're structuring your code, alternatively, a SoundManager class for AS3 can make every much easier: http://evolve.reintroducing.com/201...ndmanager-v1-4/

Mudoubleha
May 20, 2001
I have no title and I must scream.

A client just gave me a Flash banner project, with seems pretty simple, except that they want the tip of the banner to "flap" about.

Considering that the only art assets that I have from the client are layered PSDs (the banner is flat anyway), how could I easily achieve this without getting someone to redo that tip in multiple images to get an animation out?

Sromkie
Jan 9, 2011


Hello, I have a question related to a project I am building in Flash 8/AS2. I ran a search here (as well as all over Google), and I couldn't find anything specific enough to solve my challenge. I'm hoping someone here may be able and willing to help me.

I'm building an online training course within the Flash 8 Professional Slideshow (or "screens") mode. In order to help prevent learners from advancing through all of the slides before reading the content on each, I need to pause the timeline of each slide (for a specific amount of time based on a variable I set) one frame before the final frame of the slide. Then, after that set time, I would need the timeline to resume playing and continue to the last frame (on which I have just included a command to enable a NEXT button and the command to stop the timeline for the slide from starting over at the beginning).

Because I plan to use this code on each slide, I thought it would be best to build a reusable function (and then just house it on the "presentation" (parent) slide. I'm new to Flash/ActionScript, so it took me a while to figure out how to reference the function when on each individual slide, but I finally figured it out. However, for some reason, after the pause completes, and playback resumes, the stop(); command on the final frame is ignored, and the slide just replays over and over. I was hoping someone here could look at my code and tell me what I am doing wrong. I've been at this for hours and am totally lost.

Here's what I have so far:

On the "presentation" slide, which is the parent to all of my content slides, I have the following code:

CODE:
//Function to pause playback for a specified time
function pauseSlide(waitTime:Number){
	this.currentSlide.stop();
	var nDelayID:Number = setInterval(this, "resumeSlide", waitTime);
}

//Function to resume playback after the time specified by "setWait" function
function resumeSlide(){
	clearInterval(nDelayID);
	this.currentSlide.play();
}

//Function to enable next button
function enableNextButton(){
	next_btn.enabled = true;
	next_btn._alpha = 100;
}
Then, on the second to last frame of the timeline on my first content slide, I have the following code:

CODE:
//Wait 5 seconds then proceed to next frame
_parent.pauseSlide(5000);
And on the final frame of the same timeline, I have this code:

CODE:
//Enable Next button
_parent.enableNextButton();

//Stop timeline from repeating
stop();
Everything works fine except that the slide just ignores the stop(); on the last frame and replays every 5 seconds (which, based on my understanding of setInterval, makes me think it's a problem clearing the interval, but I just don't see what I've done wrong).

Any help offered on this would be much appreciated. I have Googled and Googled and Googled to no avail. While my digging has helped me to understand setInterval better, I haven't learned anything that will solve my specific issue.

Sromkie fucked around with this message at Apr 29, 2012 around 14:43

iopred
Aug 14, 2005

Heli Attack!

It could be a range of things, but the first thing that comes to mind is the main playhead is paused, but the 'currentSlide' is still playing.

Try putting a stop on the end of the slides too?

Finally if that doesn't work, check your order of operations, maybe a play is happening after than final stop. trace() is your friend.

Sromkie
Jan 9, 2011


iopred posted:

It could be a range of things, but the first thing that comes to mind is the main playhead is paused, but the 'currentSlide' is still playing.

Try putting a stop on the end of the slides too?

Finally if that doesn't work, check your order of operations, maybe a play is happening after than final stop. trace() is your friend.

Thank you for taking a stab at it. After continuing to dig, I finally found a post on another forum from someone who was having trouble clearing an interval. I looked at what solved his problem and gave it a try. Once I realized what it was, I felt like I should have seen it all along. The problem was that I was declaring the nDelayID variable within the pauseSlide function, rather than outside of it. That meant the resumeSlide function didn't have access to it. Declaring the variable outside of the function, and then editing the code so that the function only set the variable, fixed the problem entirely.

code:
//Declare variables
var nDelayID:Number 

//Function to pause playback for a specified time
function pauseSlide(waitTime:Number){
	this.currentSlide.stop();
	nDelayID = setInterval(this, "resumeSlide", waitTime);
}
Thanks again for offering your assistance. I appreciate it.

Sindow
Dec 13, 2004

Everyday I'm shufflin'.

Anyone know a fix for the render engine freezing sporadically on iOS for AIR 3.2? Until I get CS6 upgrading/downgrading the AIR version just isn't worth it right now.

jmcg_omg_kekeke
Aug 11, 2006
Lolz

Mudoubleha posted:

A client just gave me a Flash banner project, with seems pretty simple, except that they want the tip of the banner to "flap" about.

Considering that the only art assets that I have from the client are layered PSDs (the banner is flat anyway), how could I easily achieve this without getting someone to redo that tip in multiple images to get an animation out?

Best way would probably just to do some kind of perlin noise based displacement. Did some quick googling - http://www.kirupa.com/forum/showthr...Lets-make-some-(perlin)-noise!

But I'm sure you could find a better example!

Suspicious Dish
Sep 24, 2011



Yeah, a perlin-noise based displacement map. Fade it to neutral at the edge, so it looks like it's on a pole. If you want some simple shading, generate a perlin noise map with all three channels on in both directions, and overlay that on top of the image with a blending mode and low alpha.

Above Our Own
Jun 24, 2009
semi-professional sassy new forums member greeter



Hey gang, I'm looking to get into flash game development as a hobby. I was thinking the Flash Builder or whatever is the way to go, anyone want to point me in a good direction for starting out?

Suspicious Dish
Sep 24, 2011



Your options are:

Flash Professional, the animation tool from Adobe. You will need this if you want to produce any vector graphics assets without too much trouble. It's also good as an introductory start to Flash, as it gives you the timeline concept. A bit expensive at $700, but you can pay $50 a month to get the entire Adobe suite.

The open-source compiler stack from Adobe. This includes mxmlc/asc. Flash Builder and FlashDevelop build IDEs to wrap around these. There is no visual programming equivalent. Assets have to be either bitmap images or built by hand with the FXG syntax.

haXe. An alternative language that compiles to SWF. I haven't used it that much, but it's fairly popular (FlashDevelop supports it) and there's a number of game engine or game engine-y things out there built on top of it.

You might want to grab a library like Flixel or FlashPunk, too.

Above Our Own
Jun 24, 2009
semi-professional sassy new forums member greeter



Suspicious Dish posted:

Your options are:

Flash Professional, the animation tool from Adobe. You will need this if you want to produce any vector graphics assets without too much trouble. It's also good as an introductory start to Flash, as it gives you the timeline concept. A bit expensive at $700, but you can pay $50 a month to get the entire Adobe suite.

The open-source compiler stack from Adobe. This includes mxmlc/asc. Flash Builder and FlashDevelop build IDEs to wrap around these. There is no visual programming equivalent. Assets have to be either bitmap images or built by hand with the FXG syntax.

haXe. An alternative language that compiles to SWF. I haven't used it that much, but it's fairly popular (FlashDevelop supports it) and there's a number of game engine or game engine-y things out there built on top of it.

You might want to grab a library like Flixel or FlashPunk, too.
Thank you, this is very helpful information. Which do you feel has the largest support base for game development? I'm looking into everything you mentioned, but I feel that's a harder question to figure out before investing time into one of them.

Fano
Oct 20, 2010


Above Our Own posted:

Thank you, this is very helpful information. Which do you feel has the largest support base for game development? I'm looking into everything you mentioned, but I feel that's a harder question to figure out before investing time into one of them.

I've recently switched to FlashDevelop myself, and though I'm still kind of a newbie at game development and coding in general, I really really love the platform and highly recommend it. The biggest difference it made for me was that I was no longer able to animate sprites and such via the timeline in the flash IDE, though I think that's still possible if you import MovieClip assets from a compiled SWF, I forced myself to begin using tilesheets and sprite sheets instead, which has really increased my skillset.

Suspicious Dish
Sep 24, 2011



Above Our Own posted:

Which do you feel has the largest support base for game development?

Time for another secret: Flash Professional is built around mxmlc/asc as well. It just has a lot of additional stuff that no other compiler has.

I'd guess that a lot of game developers do assets in Flash Professional, export the assets to a SWF, and then write the game itself in FlashDevelop/Flash Builder. Flash Professional has a bit of a strange workflow.

If you're new to programming altogether, you might find the timeline-based workflow a bit more natural and intuitive with without building up the boilerplate of an spritesheet-based animation framework, a level editor for a custom level format (just place things on the stage!) and all that other stuff yourself.

Erasmus Darwin
Mar 6, 2001


Suspicious Dish posted:

I'd guess that a lot of game developers do assets in Flash Professional, export the assets to a SWF, and then write the game itself in FlashDevelop/Flash Builder.

If you do this, you really don't need a recent version of Flash. I seem to recall a bunch of people recommending used copies of Flash 8 as a good option if you're only using Flash to create the vector art.

Adbot
ADBOT LOVES YOU

iopred
Aug 14, 2005

Heli Attack!

FlashDevelop is a great IDE, use it if you're on Windows. If you're stuck on a Mac then go with Flash Builder. Flash IDE itself is god awful for writing code, but great for exporting assets as others have said.

If you want to make bitmap style games with Flixel, then you definitely don't need the Flash IDE, FlashDevelop will do you just fine.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«37 »