ActionScript 3.0 :: TextFormatAlign - Included The Source File *.as Files?
Jul 24, 2009
I am trying to center align a caption for a Photo Gallery.But by default the captions are aligning to Paragraph Left.You can view the link here:
Photo Gallery
-------------------------------------------------
Here is the text format code from the accompanying *.as file:
-------------------------------------------------
var tf:TextFormat=new TextFormat();
tf.font='Verdana';
tf.color=0x3;
tf.align=TextFormatAlign.CENTER;
var t:TextField=new TextField();
t.embedFonts=true;
t.alpha=0;
t.selectable=false;
t.setTextFormat(tf);
addChild(t);
-----------------------------------------------
To have an idea i also included the source file *.as files.
I am publishing and AIR 1.5 application from Flash CS4 on Mac OS X. I add a list of files to include in the Installer Settings>Included Files box. Sometimes when I publish or click "OK", the included files listing is not saved except for app swf and xml listings. This means I have to select all the files again. This does work sometimes, the files list is saved, but other times, not. It doesn't require opening and closing the Flash app, just opening and closing the dialog for it to fail to retain the list.
I understand the basics of OOP and classes, but I can't seem to find an answer to something between classes and static functions.
For instance, what if I have a Game.as class that's 1,500 lines long and I want to yank out groups of functions into external files (such as Scrolling.as or DepthManager.as)? Classes don't seem quite right, since I'm dealing mainly with the Game class variables, not separate entities. And putting one function per file would create so many dang files it's arguably worse.
So is there a way to do something like the old #include directive that will tell my Game.as class to just insert the contents of certain files into the middle of the Game.as class so I don't have to monkey with MovieClip(parents) and debugging the theoretical paths of null-object errors?
I'm guessing they took away #include for a reason, but I'm going to wear out my scroll wheel if I don't find a solution soon...
I'm in flash cs3 project. I need to create a pdf file from an image path included into an xml file or if easy also in a written path as the code below:[code]
At my job I frequently have to create Flash banners for major newspaper's websites. The specs that usually come in require a max file size of 30k or so. Usually my art department will hand me 3 or 4 screens that they want to simply move through in a loop. No biggie, until they start adding images to the files.
When I complain to them that the images are making the file sizes too big I am usually queried as to how other advertisers on these sites have full video in their ads. I understand that there are pre-loaders as well as allowed larger file sizes if you pay more for the ads.
getting image sizes down in Flash so that the images don't end up looking horrible?
I have problem with setting of TextField align. I set attribute align in TextFormat instance, then assigned TextFormat to TextField instance but i cannot see any changes when I run program. I have this code:
Code: this.nameTextFormat.align = TextFormatAlign.RIGHT; this.nameLabel.defaultTextFormat = this.nameTextFormat; trace(this.nameLabel.defaultTextFormat.align); //output is "right" what is correct.
But in real the label is aligned still left. The width of TextField is too large and text is short so I can see how it is aligned. In code, nameTextFormat is instance of TextFormat and nameLabel is instance of class which extends TextField (but there is nothing special in it).
If you have an .as file in the global include directory do you have to upload it to your server with the flash file or does it compile the flash file with the included info?
I am having trouble opening a file in the assets folder in my flex mobile application
var myFile:File = File.applicationStorageDirectory. ("@Embed('assets/file.txt')"); var myFileStream:FileStream = new FileStream(); myFileStream.addEventListener(Event.COMPLETE, glossaryFileOpened);
I purchased template and trying to edit it, there is page called portfolio i managed to make it load images from external files, but when trying to do same for text description no success. I tried different techniques i found online, but none work, only work when i place textbox on main scene but never works when i place it on Portfolio page 3 (click portfolio button then click page 3) to go there in flash find "scroll2_4" page trough library right click and chose edit. I need to load description from text for items on that page. I really desperate now after many hours of failure. url to download fla file i working with is here [URL] i edited it to delete everything thats unrelated to question. Also secondary optional question how i create more pages like page 4, 5 etc?
Currently optimizing an application at work. There are many files in some of the module projects that are not used by the exported (release build) Module.swf's. Are these unused files included in the swf's?
is it possible to send string to a class that isnt included in the same fla file.for example portfolio.fla is a main movie, it has an as file portfolio.as, work.fla is a secondary movie it has its own as file work.as, im loading work file into portoflio file and i want to pass a paramenter from portfolio.as to work.as
I have this in my code, but it doesn't seem to affect the the text in a single line text field that I am loading from XML. Can anyone offer a suggestion on how I can get my field to force justify one line of text?
var format:TextFormat = new TextFormat(); format.align = TextFormatAlign.JUSTIFY;clientClip.characteristicClip.clientCharacteristic.text = clientData[flx]["characteristics"];clientClip.characteristicClip.clientCharacteristic.defaultTextFormat = format;
I am trying to develop an android extension for air, but I have a problem with resources.According to this : Official adobe doc - FREContext and this Extending AIR by Oliver Goldman We simply have to add the resources we need in the res file of the Native part, then they are added inside the .ane file and passed to the final apk. In order to access them though we have to use getResourceId( "drawable.background_image" ) instead of R.drawable.background_image
But when I generate my extension, the res file is actually not even included anywhere inside the .ane file and also not inside the final apk. And I have found not a single extension on the net using resources (not even in the adobe samples)For this test I simply use the basic Hello world Vibrate test, but I added a new png in the drawable folder.As you can see while unziping the .ane file, then going to META-INF/ANE/Android-ARM the res file is absent.As a result, the program crashes when I try to access my resource FREContext.getResourceId("drawable.ppy_accessory_manage.png")
PS, here is my batch to compile the ANE :
set adt_directory=C:Program FilesAdobeAdobe Flash Builder 4.6sdks4.6.0in set root_directory=C:UsershugoAdobe Flash Builder 4.6 set library_directory=%root_directory%HelloANELibrary
i found a source code that helps me get around a problem i have. but i do not kno how to use the source code.Do i have to put it in a certain folder or compile it so that the fla im working in can use the methods from it?
I think i must be missing something very basic about packages and classes. I am often downloading source code from people who offer there source code on the internet. I think this is a good way to look at what people are doing and try to understand the code. Ideally I want to see the program in a .fla, see it in action when I "ctrl enter" and play with the code to change some things and learn a bit.
The thing is it always seems to be just .as files with public and private package/class code and never an actual .fla with the actual program. This is probably a really stupid question but is there a reason for this?
I'm trying to learn more about flash, and have found a couple of useful sites.However, I'm having trouble working out how to use their source files, and wondered if anyone here might be able to help please.url...I can't work out how to compile it - I know I need the Five3D files (url...), but even when I download that, and then create a .fla file in the same directory, nothing happens.I am probably missing something very obvious, but I can't work out what to do.There is a .fla file, but there is NOTHING in there that links to the .as file - there is no ActionScript at all I can see if the FLA file, that links to the .as file.
It is fully finished and before the site was finished we discussed charges for updates. They just requested the source files. We had never discussed this, and I do not want to give away my source files and all of my code. What is standard? Am I wrong to have them go through me for updates since this is what was discussed?
1. I was just wondering if anyone were able to save some of Erik Natzke's (Natzke.com) case studies especially Typography... His source files are available through Paypal but such Paypal is not offered in our country (I may not have 80$ to pay for that either
GrrrRrrRr been searching endlessly for days for tutorials or source files for the timer. Just a simple timer that counts down by minutes and seconds for 10 minutes. the closest i got are a bunch of codes that I'm not really good at translating...So could someone teach or give me a source file? just a simple timer that will trigger the end quiz page when time is up.
trying to use a CMS to import swf files. These swf files currently access source files through the standard code of: [url]...
and all works fine when testing on my machine because the swf is next to the file folder [url]....what I need to figure out is, is it possible to reference the [url]... folder as an absolute URL e.g. (http:url..) or is there another workaround I am not seeing?
I'm currently working on a Java/Flex project and I'm looking for a way to generate some parts of my Actionscript code from my Java files. One of the goal is to generate the AS valueObjects from the JAVA transferObject as well as some AS code to access the serverside function asynchronous.And other important point is that I want to be independent of some IDE. The code generation should run from Maven or Ant and take the Java source code as input.I looked a little bit around and found stuff like SpringROO, Groovy-GRAM, AST in eclipse,..
According to the answers to this question here, the reason why I'm not seeing errors as I work in Flash Builder is that FB is "optimizing" them out because they aren't referenced at any point in the code execution. Is there an option to force Flash Builder to compile all files regardless of whether they're used in the software?
I've created something that comes close.Download includes all open-source material and a manual to create your own audio-driven animations in Flash 5, and a player skinned by renascent of [URL]