JasonHippy 739 Practically a Master Poster

The easiest way would be to use the ios::app flag, this will open the file in append mode if the file exists, if it can't find the file, a new one will be created.

ofstream myfile;
myfile.open("path\filename.ext", ios::app );

Cheers for now,
Jas.

JasonHippy 739 Practically a Master Poster

I think the only way of doing it would be to create an event dispatcher in your Activity class and then set up a listener in your main class to listen for messages from the dispatcher in Activity. Then use an event handler to pass text into your Status class.

Jas.

JasonHippy 739 Practically a Master Poster

Oops, seems like I am asking too much question in this forum.... hehe..

So now in the first frame, I put (using the GUI tools) a textfield in flash CS4 and give it an instance name "Status". What I want to do is to update this status from other classes like:

public class Activity extends Sprite {
  public function DoIt() {
     /* do something */
     if(stage!=null) stage.Status.text = "done";
}
}

my problem is that "Status" cannot be accessed. Question: are objects created by the GUI automatically "private"? or what have I done wrong?

Now in the first frame of the fla i add some AS3

var activity:Acitvity = new Activity();
stage.addChild(activity); // makes activity.stage != null
trace(Status.root) // mainTimeLine, so the mainTimeLine is not in DisplayList, not under stage
trace(Status.parent) // mainTimeLine
stage.addChild(Status)// place it on stage, hope activity can access it
trace(Status.root) // stage
trace(Status.parent) // stage

Question: activity still cannot access stage. so what is the difference between mainTimeLine and stage?

I could be wrong, but I believe that the stage is only accessible from the main class in your app. I've not used CS4 before, but I have found this problem when coding AS3 projects in Flashdevelop.

Consider this pointless random example, this is a Flashdevelop example!

We have a simple class called Thing which just contains a single property called thingSize, which we are trying to set to the value of stage.stageHeight/4:

package 
{
	
	/**
	 * ...
	 * @author Jason Trunks
	 */
	public class …
JasonHippy 739 Practically a Master Poster

Hi all,

The previous flash 8 I used has got an swf player such that when I open the swf from the windows folders, the swf runs in its own standalone player. (not the exe projector)

But recently I tried to do the same for Flash CS4, the swf does not run. During the installation I skipped all the other misc programs. Is anyone of them required to run the swf?


Regards
Jake

I'm not sure I follow you? I got that you had flash 8 installed and clicking the .swf runs it in a standalone player, but what's happening with CS4?? What extra programs did you skip?? I've not used CS4, so I don't know what ships with it! For all of my AS3 stuff I've been using Flashdevelop, but I still use flash 8 pro for video encoding!

It sounds like you don't have flashplayer installed properly...
If no .swfs work at all, then you need to install the latest version of flash player.
If your old flash 8 .swf's work but the .swf's created in CS4 don't, then you'll need to update your flash-player to the latest version.

Other than that, I can't really see a problem!

JasonHippy 739 Practically a Master Poster

Hi all,

Need some advice here: I wrote some code to recieve KeyboardEvents but when I "Test Movie" inside the flash program, many keys are being captured by the flash program instead of my swf test movie. Most notably, all alphabets are trapped only numbers are detected within the swf. if I embed in html and run it in a web brower, it works fine.

is this the correct behavior? Isn't this ... quite dumb? Is there anyway to fix this?

Thanks!

PS: BTW, I'm utterly surprised there's no dedicated forum for flash here. Why?

So your actionscript is ok, and it picks up keypresses properly in an external instance of flash-player or on a web page but not when debugging in the IDE?

Sounds like the keybindings for your IDE are intercepting your keypresses, so they are not even getting to your .swf. There isn't really a lot you can do about it.

If you're using Flashdevelop to build and test your .swfs, you can set your options to allow you to test movies in an external instance of flash-player instead of an instance embedded in the IDE. That should solve the problem.

But if you're using one of the Adobe Flash IDE's, I'm not sure if you have the option to do this or not...Might be worth taking a look. If not, I'd recommend opening your .swfs directory and manually running the .swf to test it...which sucks, but it's the only way!

You'll also …