¡Hola y Bienvenidos!

Stacey Tipton Reiman's space for organizing code snippets and gathering info about RIA and IOS dev ideas and trends...

19 October 2011 ~ 1 Comment

Nerd Heaven: App Challenge Finalist and Sony Tablets Galore!

I haven’t posted in ages as I dove head first into app development this summer, and have hardly surfaced for air since. I am psyched to report that my InstaSpanish Kids App has been chosen as a finalist in the Adobe Air/Sony App Challenge, and they sent me 2 interesting tablets to test with, and gave me access to some sweet new code over at the Adobe Prerelease program. Wow!

adobe-air-app-challenge

I plan on doing an article and maybe a tutorial on my development process, as well as the process of trying to get an app promoted and actually SOLD via the 4 avenues I’m pursuing right now: Barnes and Noble (Color Nook tm), Apple, Amazon, and Android. So far the Android Market has left me totally unimpressed as a potential for sales, as most people on there have phones that are just not my target market as far as a kids elearning app goes. Also, they make it impossible to upgrade an app published on a new computer, something to do with the certificate not being read as the same, even though it IS in fact the same certificate! So I’m having to leave my current customers high and dry and publish a totally new app, wasting the time I spent submitting the app to places around the web as well. What a waste…

Using Flash CS5.5 for development has been fun – while I probably should have used Flex, I guess I just wanted the design aspects that Flash offers. Based on some great feedback from a review site, I’m running an icon contest over at 99Designs.com, where my contest is probably too underfunded to attract anybody – I’m not sure, as they’ve changed things a lot since my last contest. I probably asked for too much for too little…but I didn’t want to spend $600, which was the only other option.

Development has been easier than I thought, with the exception of trying to get the touch and throw components working properly, and implementing good swipe gestures for some page turning.

I’m really excited about the Barnes and Noble store – I love the Color Nook tm (they want you to use the [tm] whenever you talk about it!), and the developers at their app program have been super responsive and friendly.

Apple is the big question mark, as I have no idea how tough it is to get into their store, or get some promotion once you are in. One piece of serious frustration is that I actually had to BUY an iMac just to upload my app, aggghh!!  Then it turned out that since I published it via my new iMac instead of the PC, the fonts were not exactly the same, so I had to delete my freshly uploaded app and plan to republish from the PC today, and re-upload. Now that is a serious pain. And was a pain in the wallet too, although I do like a few things about this new machine. Spent a few hours monkeying with things before I figured out how to use Quartz Debug to adjust the scaling. Does Apple seriously think people can read like 6 pt fonts on a 21.5 inch screen?

I haven’t been on Twitter much, I just kind of check Echofon occasionally, and tweet a reply if I see something interesting. Still a bit information overload for me.

I am also now using the Windows 8 Developer Preview on my PC…which seems to be a killer upgrade once you disable the ridiculous green interface and the jumbled, disorganized mess that it represents. They need to seriously kill that thing off – how the hell can a person trying to use the PC for work deal with that jumpy, useless mess of tiles? Give me back the regular desktop, thanks very much. A quick regedit adjustment will get your Win 7 look back.

Alright enough for now – but much more to come on the mobile front!

07 August 2011 ~ 0 Comments

Why DOS Can Still Rock the Desktop…

REM ## This file is everything I love about using batch files for quick desktop operations. This little script will:

REM 1- use the lesson folder names as a variable
REM 2- capitalize the first letter and strip underscores when using the folder name as a title
REM 3- grab the word lists from all of the lesson folders and use the first word as the Spanish variable, the second as the English variable on each line
REM 4- strip Spanish accent characters from words used for mp3 or image names
REM 5- write a unique slideshow.txt config file for each lesson
REM 6- begin each config file with a non looping slideshow lesson title section
REM 7- iterate through the word lists to create unique slides using the Spanish and English words as variables for words, images, and audio
REM 8- keep a count in order to correctly number each slide
REM 9- save each slideshow.txt to the /glossary folder of the appropriate lesson unit, for use in generating the actual slideshow. This can be done in batch as well...

REM I'd like to see somebody show me another way to do all of the above with 1 click on your desktop, without installing a bunch of tools that require me to run everything from the command line or another shell, or with less code than this. Really no point anyway, as this code just simply works.

REM By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

@echo off

REM let's setlocal and enable delayed expansion since that's what DOS needs to see in order to work with the variables in the way we've laid out below!

setlocal ENABLEDELAYEDEXPANSION&pushd %~dp0

REM add our alphabets for upper and lower case...
set UCase=ABCDEFGHIJKLMNOPQRSTUVWXYZ
set LCase=abcdefghijklmnopqrstuvwxyz

REM let's make a loop that will create a variable for each folder/directory in the list we already made with a previous batch file [each name or variable is marked by a new line in this file, directory_list.txt]

for /f "tokens=1 delims=." %%n in (directory_list.txt) do (
set dirs=%%n

set uppercase_dirs=%%n

REM here is the code that capitalizes ONLY the first letter of each word to uppercase, and removes any dashes or underscores, for nice titles

echo here is my raw folder name: !dirs!

set myfirst=!dirs:~0,1!
for /L %%A in (0,1,25) do Call :ToUpper !LCase:~%%A,1! !UCase:~%%A,1!
set uppercase_dirs=!myfirst!!dirs:~1!
set uppercase_dirs=!uppercase_dirs:-= !
set uppercase_dirs=!uppercase_dirs:_= !

echo here is my newly upper case'd title: !uppercase_dirs!
pause
REM /end code that capitalizes first letter

set fileoutta=!dirs!/glossary/slideshow.txt

echo here is my folder/directory !dirs!
echo here is my file out !fileoutta!
pause 

REM OK now let's begin writing our slideshow configuration file, anything in the following section will only be written once
echo @@ Section, Category, and Lesson Info @@ >> !fileoutta!
pause
echo _show-!dirs!  >> !fileoutta!
echo _Kids  >> !fileoutta!
echo _Week  >> !fileoutta!
echo _!dirs!  >> !fileoutta!
echo _!uppercase_dirs!  >> !fileoutta!
echo _!dirs!  >> !fileoutta!
echo _!uppercase_dirs!  >> !fileoutta!

echo here is my directory/folder again !dirs!

REM /end of the "write only once" section at the top of each slideshow.txt

REM let's start a count, shall we? Start at 1
set /a Cnt=1

echo _@@ Slide !Cnt! [string, title, image, animation, audio] @@  >> !fileoutta!
echo _q6-0-0-blue-translation-!uppercase_dirs!-false  >> !fileoutta!
echo _q1-0-300-blue-null-false >> !fileoutta!
echo _q7-null >> !fileoutta!
echo _q7-bubby!dirs!.swf-null-0-0-s1 >> !fileoutta!
echo _null >> !fileoutta!

REM OK now let's add a loop that will iterate through the word list, and create 2 slide types that will keep replicating until the glossary wordlist for that directory/folder is complete...

FOR /F "tokens=1,2 delims=_" %%A in (!dirs!/glossary/glossary.txt) do (

REM Let's keep adding to the count, adding another number for every REGULAR slide we produce

set /a Cnt+=1

REM let's set the Spanish word to the first variable, and the English word to the second [found in glossary.txt]
set spanish_word=%%A
set english_word=%%B

set spanish_word_no_accent=%%A

REM let's strip the spanish accents from words we are using for image or mp3 files...
set spanish_word_no_accent=!spanish_word_no_accent:é=e!
set spanish_word_no_accent=!spanish_word_no_accent:á=a!
set spanish_word_no_accent=!spanish_word_no_accent:í=i!
set spanish_word_no_accent=!spanish_word_no_accent:ó=o!
set spanish_word_no_accent=!spanish_word_no_accent:ú=u!
set spanish_word_no_accent=!spanish_word_no_accent:ñ=n!
set spanish_word_no_accent=!spanish_word_no_accent:¿=!
set spanish_word_no_accent=!spanish_word_no_accent:?=!
set spanish_word_no_accent=!spanish_word_no_accent:¡=!

echo _@@ Slide !Cnt! [string, title, image, animation, audio] @@ >> !fileoutta!
echo _q6-0-0-blue-!spanish_word!-!english_word!-false >> !fileoutta!
echo _q2-0-0-redbold-null-false >> !fileoutta!
echo _q7-!spanish_word_no_accent!.swf >> !fileoutta!
echo _q7-null-null-0-0-s1 >> !fileoutta!
echo _!spanish_word_no_accent!.mp3 >> !fileoutta!

REM Let's keep adding to the count, adding another number for every SCRAMBLE slide we produce

set /a Cnt+=1

echo _@@ Slide !Cnt! [string, title, image, animation, audio] @@ >> !fileoutta!
echo _q6-0-0-blue-null-%%B-false >> !fileoutta!
echo _q1-0-450-instruct-%%A-false >> !fileoutta!
echo _q10-!spanish_word_no_accent!.swf >> !fileoutta!
echo _q9-scramble.swf-null-0-0-s1 >> !fileoutta!
echo _!spanish_word_no_accent!.mp3 >> !fileoutta! 

REM /end of the looping of the 2 slides in the slideshow.txt 

REM end for loop
)

REM end !dirs! for loop
) 

cls
endlocal
REM here is our function that performs the uppercase on the first letter of each word in our title
:ToUpper Low Up
set uppercase_dirs=!uppercase_dirs:-%1=-%2!
set uppercase_dirs=!uppercase_dirs:_%1=_%2!
set myfirst=!myfirst:%1=%2!

04 August 2011 ~ 0 Comments

DOS Extract Strings from Binary Files

REM ## I needed to get JUST THE STRINGS out of the hex dump of some binary files... Not so easy to do! But I found the awesome Swiss File Knife program here: http://stahlworks.com/dev/swiss-file-knife.html, and threw the sfk.exe into the root directory of a bunch of nasty old files I wanted to tackle.  In this case, the files were 2 levels deep inside of folders that were named the same as their parent folder, as you see here below. You can adjust this in a lot of ways to batch handle really old binary files and extract data that you might actually be able to use today...  By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

@echo off

setlocal ENABLEDELAYEDEXPANSION

set fileout=txts/master_file.txt

for /f %%A in ('dir  /O:N /L /B  /N') do (

set batchdirs=%%A

FOR /F "tokens=1,2 delims=._ " %%A in ( 'dir !batchdirs!\!batchdirs!\ /O:N /L /B  /N *.LSN .CRS .EXE') do (
set filey=%%A
set extension=%%B
echo %%A.%%B
sfk strings !batchdirs!\!batchdirs!\!filey!.!extension! > batch\!batchdirs!\txts\!filey!.txt
rem pause
echo %%A >> !fileout!

)

)

cls
endlocal

The site for that great Swiss File Knife program is here:
Swiss File Knife

03 August 2011 ~ 0 Comments

DOS Delete all .svn Files

REM ## this is one I dont want to forget...how to obliterate all traces of .svn files for a project I'm trying to move. Just throw into any directory where you have .svn files, including ones in subdirectories - careful though, as once you run this they are gone for good. By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

FOR /F "tokens=" %%G IN DIR /B /AD /S .svn DO RMDIR /S /Q "%%G"

via [DOS] DOS Delete all .svn Files – Pastebin.com.

Tags: , , , ,

02 August 2011 ~ 0 Comments

DOS Quick File Organizer and Mover

REM ## this is a script I use sometimes to organize the mess that becomes of some of my dev folders. Seems I don't have the patience and/or organization skills to properly organize files at the time of writing them...so this helps me create some organization for files that have become a jumbled mess. It isn't well coded using vars to easily amend, but you can adjust all of the files and folders as you see below. To use, just drop this into a folder that needs organiztion and click. By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

@echo off

setlocal ENABLEDELAYEDEXPANSION&pushd %~dp0

for %%* in (.) do  (
@echo %%~n*
set myvar=%%~n*
)

if not exist aaFLAS mkdir aaFLAS
if not exist pngs mkdir pngs
if not exist jpgs mkdir jpgs
if not exist gifs mkdir gifs
if not exist html mkdir html
if not exist graphics mkdir graphics
if not exist pdfs mkdir pdfs
if not exist zips mkdir zips
if not exist txts mkdir txts
if not exist spreadsheets mkdir spreadsheets

set fileoutta=filesmoved.xml

for %%* in (.) do  (
@echo %%~n*

for /f "tokens=1,2 delims=." %%a  in ( 'dir /o:n /l /b  /n *')  do ( 

if %%b==jpg (
set jpg=%%a.jpg
set /a Cnt+=1
echo hey let's move this file: %%a.jpg  >> !fileoutta!
)
if %%b==jpeg (
set jpeg=%%a.jpeg
set /a Cnt+=1
echo hey let's move this file: %%a.jpeg  >> !fileoutta!
)
if %%b==png (
set png=%%a.png
set /a Cnt+=1
echo hey let's move this file: %%a.png >> !fileoutta!
)
if %%b==ai (
set ai=%%a.ai
set /a Cnt+=1
echo hey let's move this file: %%a.ai  >> !fileoutta!
)
if %%b==psd (
set psd=%%a.psd
set /a Cnt+=1
echo hey let's move this file: %%a.psd  >> !fileoutta!
)
if %%b==edx (
set edx=%%a.edx
set /a Cnt+=1
echo hey let's move this file: %%a.edx  >> !fileoutta!
)
if %%b==gif (
set gif=%%a.gif
set /a Cnt+=1
echo hey let's move this file: %%a.gif  >> !fileoutta!
)
if %%b==pdf (
set pdf=%%a.pdf
set /a Cnt+=1
echo hey let's move this file: %%a.pdf  >> !fileoutta!
)
if %%b==zip (
set zip=%%a.zip
set /a Cnt+=1
echo hey let's move this file: %%a.zip  >> !fileoutta!
)
if %%b==fla (
set fla=%%a.fla
set /a Cnt+=1
echo hey let's move this file: %%a.fla >> !fileoutta!
)
if %%b==as (
set as=%%a.as
set /a Cnt+=1
echo hey let's move this file: %%a.as  >> !fileoutta!
)
if %%b==swf (
set swf=%%a.swf
set /a Cnt+=1
echo hey let's move this file: %%a.swf  >> !fileoutta!
)
if %%b==htm (
set htm=%%a.htm
set /a Cnt+=1
echo hey let's move this file: %%a.htm  >> !fileoutta!
)
if %%b==html (
set html=%%a.html
set /a Cnt+=1
echo hey let's move this file: %%a.html  >> !fileoutta!
)
if %%b==txt (
set txt=%%a.txt
set /a Cnt+=1
echo hey let's move this file: %%a.txt  >> !fileoutta!
)
if %%b==csv (
set csv=%%a.csv
set /a Cnt+=1
echo hey let's move this file: %%a.csv  >> !fileoutta!
)
if %%b==xls (
set xls=%%a.xls
set /a Cnt+=1
echo hey let's move this file: %%a.xls  >> !fileoutta!
)
rem for /L %%A in (0,1,25) do Call :ToUpper !LCase:~%%A,1! !UCase:~%%A,1!

if exist !jpg! move "!jpg!" jpgs
if exist !jpeg! move "!jpeg!" jpgs
if exist !png! move "!png!" pngs
if exist !gif! move "!gif!" gifs
if exist !ai! move "!ai!" graphics
if exist !edx! move "!edx!" graphics
if exist !psd! move "!psd!" graphics
if exist !pdf! move "!pdf!" pdfs
if exist !zip! move "!zip!" zips
if exist !as! move "!as!" aaFLAS
if exist !swf! move "!swf!" aaFLAS
if exist !fla! move "!fla!" aaFLAS
if exist !htm! move "!htm!" html
if exist !html! move "!html!" html
if exist !txt! move "!txt!" txts
if exist !csv! move "!csv!" spreadsheets
if exist !xls! move "!xls!" spreadsheets

)
)

echo Great I moved !Cnt! files >> !fileoutta!

cls

endlocal

via [DOS] DOS Quick File Organizer and Mover – Pastebin.com.

01 August 2011 ~ 0 Comments

AS3 Toggle Button with MuteSounds

/* I have an educational slideshow template that has audio, and I needed a button to mute the audio on demand. I also applied a sort of 'grey out' effect via alpha, in case the button has already been clicked. I also used this same code to show or hide the English translation for pages, which made me think that I better save this snippet for future use! By Stacey Tipton Reiman, www.akwebgenius.com/blog */

// your imports - in addition to all of the regular stuff, you need to have SoundTransform for this to work...

import flash.media.SoundTransform;  

// you'll need the audioBtn

[Embed(source="C:/path_to_your_btn/audio.swf")]
 public var AudioBtn:Class;  

var audioBtn = new AudioBtn();
audioBtn.width = 35
audioBtn.height = 35
audioBtn.x = 595
audioBtn.y = 5
addChild(audioBtn)

// and your event listener needs to be added...

audioBtn.addEventListener(MouseEvent.MOUSE_DOWN, muteSounds); 

// you also need a textField and a format [format is not included...]

var audio_toggle_txt:TextField = new TextField;  

addChild(audio_toggle_txt);
audio_toggle_txt.x=563;
audio_toggle_txt.y=45;
audio_toggle_txt.embedFonts = true;
audio_toggle_txt.wordWrap = true;
audio_toggle_txt.autoSize="left";
audio_toggle_txt.defaultTextFormat = format;
audio_toggle_txt.text = 'sound' + '\n' + 'control' ;  

// Variable to detect whether the number of times the toggle button has been clicked.  

var clickOnce:uint=0;  

function muteSounds(event:MouseEvent):void
{
clickOnce++;
if (clickOnce==1)
{
SoundMixer.soundTransform = new SoundTransform(0);
audioBtn.alpha = .4;
audio_toggle_txt.text = 'audio' + '\n' +  'OFF';
}
if (clickOnce==2)
{
SoundMixer.soundTransform = new SoundTransform(1);
clickOnce=0;
audioBtn.alpha = 1;
audio_toggle_txt.text = 'audio' + '\n' +  'ON';
}
}

via [ActionScript 3] AS3 Toggle Button with MuteSounds – Pastebin.com.

Tags: , , , ,

01 August 2011 ~ 0 Comments

DOS Batch XML Editor / Append Node

REM ## this is a super handy script that works as a Batch XML Editor. I can take any large group of XML files, and add a new dynamic node, switching out the variables by using the file name. You could switch out using file name for some other variable, or other ones that you set elsewhere - but for my purposes this was exactly what I needed to do. I didn't find many good batch XML editing things online, especially where I could use my name variables to write unique XML to each of the  100+ files I was dealing with. Hand editing XML is a nightmare, and prone to errors galore, so scripts like this can be a life saver. To use it, place all of your XML files in a subfolder /xml. Make sure the names of these files match up to the values you are trying to write, or change the XML node values below to something static. By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

@echo off

setlocal ENABLEDELAYEDEXPANSION

REM delete the new xml folder is we are running this for the 2nd time
if exist new_xml del new_xml

REM create a folder for our new updated XML files
if not exist new_xml mkdir new_xml
if exist xml_list.txt del xml_list.txt

REM find all of the XML files within the xml\ folder
FOR /F "tokens=1,2 delims=." %%A in ( 'dir xml\  /O:N /L /B  /N *.xml') do (

set /A Cnt+=1

REM this will take all of the names of the XML files and create variables, which will be used in all of the new XML files so that they contain the correct information. NOTE!! Your file names need to be the same as the variables you want to use in your nodes! In my case, my lessons are all named like colors, body_parts, numbers, etc - so the xml files are colors.xml, body_parts.xml, numbers.xml, etc. Then this value is used within the new crossword XML node.

set filename=%%A

set fileout=new_xml\!filename!.xml
set filelist=xml_list.txt

REM this is the node I am appending my new xml node BEFORE... - replace with whatever unique node you want to search and append in your own XML files

findstr  /v "</lessons>" xml\!filename!.xml > !fileout!
rem findstr  /v "</param>" !filename!.xml > !fileout2!

REM this is my new node, appended to all of the 100+ XML files in my folder

echo ^<row lessonTitle="Crossword Puzzle" fileName="crossword.swf" xmlPath="your_xml_path/lessons/!filename!/xml/crossword.xml" tutorFile="assets/images/pic.swf" lessonIcon="crossword" activityId="!filename!crossword" completed="False" type="activity"/^> >> !fileout!
echo  ^</lessons^>  >> !fileout!
rem echo  ^<value^>%1^</value^>  >> !fileout2!

echo Processing the XML file !filename!.xml
echo !Cnt!
echo !filename! >> !filelist!

)

echo AWESOME^^!...I just created !Cnt! new XML Files!
echo !Cnt! >> !filelist!
pause
cls
endlocal
echo GREAT check the filelist.txt file to see the names of your XML files and COUNT
type xml_list.txt
pause
Tags: , , , , ,

31 July 2011 ~ 0 Comments

AS3 PNG to SWF Animation Generator

REM ## this little animation generator (DOS and AS3, uses Flex SDK for compiling SWF) is something I did while working on a large project that required me to grab pieces of video and recreate the animations. I ran the AVIs through an AVI to PNG app, using a rate of anywhere from 20 to 70 screens per seconds, then threw them into here for a quick animation. While this isn't going to produce any kind of beautiful vector animation, it is useful for those times when you have to resort to something like PNGs for a quick animation. You can also use JPGs with this script, although to use SWFs you have to alter it a little. You need the free Greensock tweening engine placed in the /com folder, as well as a path to the Flex 3.2 open source SDK in order to use this generator. Your pngs should reside in the /pngs folder, and you'll have to adjust the paths that are marked by Important!! below. This script will use the foldername the .bat is executed in as the name of the actionscript class as well as the SWF file - do NOT use any dashes or underscores in this name. By Stacey Tipton Reiman www.akwebgenius.com/blog ##

@echo off

setlocal ENABLEDELAYEDEXPANSION

REM slideshow settings are here:

rem time1 is the fade in time

set time1=0.1

rem time2 this is the slide length time

set time2=.04

rem time3 this is the fade out time

set time3=0.1

set fadeout=no

REM Important!! Change the path to your actual path, using FORWARD / slashes - don't include actual folder name

set path1=C:/path_to_your_folder/

REM Important!! Change the path to your actual path, using BACKWARD \ slashes - don't include actual folder name

set path2=C:\path_to_your_folder\

if exist pngs_to_swf.bat del pngs_to_swf.bat

for %%* in (.) do (

@echo %%~n* this is your current directory, which we will use as a variable

set myvar=%%~n*

)

if exist !myvar!.as del !myvar!.as

if exist !myvar!.swf del !myvar!.swf

set fileoutta=!myvar!.as

pause

echo package >> !fileoutta!

echo { >> !fileoutta!

echo import flash.display.Sprite; >> !fileoutta!

echo import flash.display.Bitmap; >> !fileoutta!

echo import flash.display.*; >> !fileoutta!

echo import flash.filters.*; >> !fileoutta!

echo import flash.events.Event; >> !fileoutta!

echo import flash.text.*; >> !fileoutta!

echo import flash.utils.getDefinitionByName; >> !fileoutta!

echo import flash.display.MovieClip; >> !fileoutta!

echo import com.greensock.easing.*; >> !fileoutta!

echo import com.greensock.*; >> !fileoutta!

echo import com.greensock.TweenMax; >> !fileoutta!

echo import com.greensock.TweenLite; >> !fileoutta!

echo import com.greensock.TimelineMax; >> !fileoutta!

echo import com.greensock.events.TweenEvent; >> !fileoutta!

echo import events.VariableHolder; >> !fileoutta!

echo import events.ListensForEvent; >> !fileoutta!

echo public class !myvar! extends Sprite >> !fileoutta!

echo { >> !fileoutta!

)

FOR /F "tokens=1,2 delims=." %%A in ( 'dir pngs\ /O:N /L /B /N *.png') do (

set /A Cnt+=1

set county=!Cnt!

set pic=%%A

set /a N+=1

REM Important!! Change the path1 variable above to your actual path, assuming also you have a /pngs folder containing your images

echo [Embed^(source="!path1!!myvar!/pngs/!pic!.png"^)]>> !fileoutta!

echo public var Picture!N!:Class; >> !fileoutta!

)

echo public function !myvar!^(^) >> !fileoutta!

echo { >> !fileoutta!

FOR /F "tokens=1,2 delims=." %%A in ( 'dir pngs\ /O:N /L /B /N *.png') do (

set /a V+=1

set /a Z+=1

set pic=%%A

echo var pic!V!:Bitmap = new Picture!V!^(^); >> !fileoutta!

echo addChild^(pic!V!^); >> !fileoutta!

echo pic!V!.width = 640 >> !fileoutta!

echo pic!V!.height = 480 >> !fileoutta!

echo pic!V!.x = 0 >> !fileoutta!

echo pic!V!.y = 0 >> !fileoutta!

echo pic!V!.alpha = 1; >> !fileoutta!

)

echo var timeline:TimelineMax = new TimelineMax^({repeat:0, paused:false, autoRemoveChildren:true, onComplete:removeAll}^); >> !fileoutta!

echo var tween:TweenMax = null; >> !fileoutta!

echo timeline.insertMultiple^( TweenMax.allFrom^([>> !fileoutta!

FOR /F "tokens=1,2 delims=." %%A in ( 'dir pngs\ /O:N /L /B /N *.png') do (

set pic=%%A

set /a X+=1

if !X! lss !county! echo/|set /p=pic!X!,>> !fileoutta!

if !X! equ !county! echo/|set /p=pic!X!>> !fileoutta!

)

echo ], !time1!, {autoAlpha:0, delay:0}, !time2!^), !time3!^);>> !fileoutta!

echo function removeAll^(^):void >> !fileoutta!

echo { >> !fileoutta!

FOR /F "tokens=1,2 delims=." %%A in ( 'dir pngs\ /O:N /L /B /N *.png') do (

if fadeout==yes (

set pic=%%A

set /a T+=1

echo removeChild^(pic!T!^); >> !fileoutta!

)

)

echo } >> !fileoutta!

echo } >> !fileoutta!

echo } >> !fileoutta!

echo } >> !fileoutta!

pause

set masterf=pngs_to_swf.bat

REM IMPORTANT!! path2 variable above needs to be changed to match your Adobe Flex 3.2 sdk bin!

echo cd C:\Program Files ^(x86^)\Adobe\Flex Builder 3\sdks\3.2.0\bin\ >> !masterf!

for /f "tokens=1,2 delims=." %%a in ( 'dir /O:N /L /B /N /a-d *."as"') do (

@echo off

echo mxmlc -default-size=640,480 -optimize=false -debug=false -default-background-color=^#000000 !path2!!myvar!\!myvar!.as >> !masterf!

)

if exist pngs_to_swf.bat call pngs_to_swf.bat

cls

endlocal

pause

via [DOS] AS3 PNG to SWF Animation Generator – Pastebin.com.

31 July 2011 ~ 0 Comments

AS3 Add TextField with Format

// here are your imports

import flash.text.TextFormat;

import flash.text.AntiAliasType;

import flash.text.*;

// here is your text format - Verdana would need to be embedded via AS3 or in the Flash IDE

var format:TextFormat = new TextFormat();

format1.font="Verdana";

format1.size=18;

format1.bold = true;

format1.color = 0x000000;

format1.letterSpacing=2;

// I usually center my textFields.

format1.align = TextFormatAlign.CENTER;

// here are your variables

var stringWidth = 100;

var stringX = 0;

var stringY = 0;

var string = "here is your string"

// here is your actual textField

var string_txt = new TextField();

addChild(string_txt);

string_txt.width=stringWidth;

string_txt.x=stringX;

string_txt.y=stringY;

string_txt.embedFonts = true;

string_txt.wordWrap = true;

string_txt.autoSize="left";

string_txt.defaultTextFormat = format1;

string_txt.htmlText = string;

via [ActionScript 3] AS3 Add TextField with Format – Pastebin.com.

31 July 2011 ~ 0 Comments

DOS Create .txt List of Folders

REM ## simply creates a .txt list of all of the folders in the directory where the .bat file is executed. By Stacey Tipton Reiman, www.akwebgenius.com/blog ##

@echo off

setlocal ENABLEDELAYEDEXPANSION&pushd %~dp0

if exist directory_list.txt del directory_list.txt

set fileout=directory_list.txt

for /f %%R in ('dir /a /b /ad ') do call :1 %%R

goto :eof

:1

%1

echo %1>>!fileout!

cls

endlocal

via [DOS] DOS Create .txt List of Folders – Pastebin.com.