Skip to content
February 6, 2013 / Danii Oliver

Naming multiple instances and arguments in For Loop

This is the syntax for when you want to tell multiple instances to do the same thing but you don’t want to have to type the commands one by one.
With this setup you can just tell it once all you want it to do then stick in a for loop and it will run as many times as there are instances named and specified

for(var i:uint=0;i<4;i++){
this["pic"+i].buttonMode=true;
this["pic"+i].x=-700;
this["pic"+i].y=1100;
this["pic"+i].alpha=0;
this["pic"+i].mouseEnabled=true;
}

In Robotlegs if you are building a Flash Professional your syntax will be a bit different.
For instance if the items you are trying to target are within an Injected class you must create your naming string first and replace “this’ with the [Inject] public var name then the created string inside the brackets not concatenation  It will be more like you a writing in the form of KEY[VALUE].property = or KEY[VALUE].method().

var table:String;
var hover:String;

for (var i:uint = 0; i < 5; i++)
{
table = “table” + i;
hover = “coverHover” + i
view[table].buttonMode = true;
view[table].addEventListener( MouseEvent.MOUSE_DOWN, liftCover, false, 0, true );

view[hover].stop();
view[hover].visible = false;
view[table].addEventListener( MouseEvent.MOUSE_OVER, hoverCover, false, 0, true );
view[table].addEventListener( MouseEvent.MOUSE_OUT, offCover, false, 0, true );
}

December 4, 2015 / Danii Oliver

Working with HTML5 Banner Ads

Whether a HTML 5 build or a SWIFFY export if your banner ads are to eventually be served from double click ( most are even when using a 3rd party vendor ) you need to have a few basic lines of code in order for the ads to not throw errors.

 

<meta name=”ad.size” content=”width=300,height=250″>

var clickTag = “”;

https://s0.2mdn.net/ads/studio/Enabler.js

linkToCTA = function(e) {
try {
Enabler.exit(‘CTA’);
} catch (err) {
window.open(clickTag, “_blank”);
}
};

<a id=”btn_cta” href=”javascript:window.open(window.clickTag);void(0)”></a>

November 24, 2015 / Danii Oliver

Compass Sass Error

Error: array size too big for `sprite-url’
on line 185 of art/*.png …

this means that one of the images is corrupted. Try to open each process of illumination unless you know how do the following…
“if you have a full stack trace you can probably make it catch the exception if you know what you’re looking for”

November 16, 2015 / Danii Oliver

Swiffy

Documenting my first endeavor into Swiffy ( lazy Flash banner ad redo for HTML 5) Personally I believe that unless you don’t have access to the assets it should just be rebuilt with Greensock and JavaScript…. The code actually translates… so why not?

Here goes nothing.

Step 1:
Upload the .SWF file you exported from Flash to the Swiffy site https://developers.google.com/swiffy/convert/upload. Check the box and click the upload button.

ERROR ALERT: Caution: this conversion cannot be uploaded to AdWords or DoubleClick directly. If your SWF converts without errors, you can upload the SWF file directly to AdWords or DoubleClick, and they’ll handle the conversions for you!

If you are using this tool for eventual upload to Double Click, because of this error when uploading on the site, it is best to install the extension for Flash swiffy.1.1.1.mxp.
Download it from here  https://developers.google.com/swiffy/convert/flash-extension
i
t will install with the Adobe Extension manager. Find it by opening Flash professional then navigate the menu bar Commands > Export and HTL5 (Swiffy). NOW comes the part that makes this tool a tool for Developers and not a death to Flash and HTML/JS/CSS expertise.

Step 2:
Remove the obfuscated swiffyobject code, place in an external js file for clarity sake.
Style the page as needed then run.

Level of difficulty: Low.

Level of work: Click a button

October 16, 2015 / Danii Oliver

Veeva Projects

1.)

copy the following files into the the same directory as the .hmtl and folders

[
veevaSlideZipper.bat
VeevaSlideZipper.jar
veevaSlideZipper.sh
]

VeevaSlideZipper is used to compress the slide files before uploading them to Veeva(via test.salesforce.com). Before running the zipper, make sure the root directory contain:

sample-slide.html;
sample-slide(folder with the same name as the html file).
veevaSlideZipper.bat
veevaSlideZipper.jar
veevaSlideZipper.sh
2.)
in command line navigate to the direcotry and type the follow

[ sh veevaSlideZipper.sh ]

(svn files will have been removed and zip files created)
(if there is a folder with a .PDF zip the folder separately then replace the zip in the _zips directory)

Then go to Terminal:

$ cd sample_directory/
$ sh veevaSlideZipper.sh

After running each html file should have a corresponding zip file. The zip files should be in the newly generated “_zips” folder.
3.) Migrating to Sales force via server upload
Server Creds (Mount a saved short cut to you GUI of choice)

FTP:
USER:
PASSWORD:

4.)
remove home.zip & sample.zip
On the server transfer the _zip folder contents (not _zips)
to the ROOT of the server
5.)
remove sample.ctl
On the server transfer the contents of _veeva/ctlfiles
to the /ctlfile of the server
6.)
Wait 2-5 Minutes.
Refresh server root view. When all .zip files are gone the veeva presentation is ready to be synced on an iPad

If on Veeva App account login
USER
PASSWORD
Then sync.

?.)
Having an issue? Login to your Veeva Sales Force account and check that the updated files have been accepted.

October 5, 2015 / Danii Oliver

Working with Web Audio API

...living post not yet completed

Building Standard and Complex Functionalities

(that do not exist)

In the event of not having a built in API method, a developer needs to use the tools she has to create what we call a hack. A work around to piece together various parts that will give us a desired outcome.

Building the following Functionality with the Web Audio API

Stop Play Pause   [ See the Code >> ](Coming Soon)

Audio Channel Splitting  [ See the Code >> ](Coming Soon)

Audio Channel Swapping  [ See the Code >> ](Coming Soon)

October 5, 2015 / Danii Oliver

Starting with Web Audio API

With the use of crossfading through the Web Audio API and a single video file I will be creating an interactive experience that brings a little bit of magic to tablet devices with the touch of your finger. My goal is to swap between to separate Audio Visual assets in an extremely seamless way.

Further reading on the Web Audio API here.

Getting Started:

First:

Initialize an AudioContext. Only one is needed and will serve the needs of multiple audio files and actions.

var context;
window.addEventListener('load', init, false);
function init() {
  try {
    // Fix up for prefixing
    window.AudioContext = window.AudioContext||window.webkitAudioContext;
    context = new AudioContext();
  }
  catch(e) {
    alert('Web Audio API is not supported in this browser');
  }
 

or simply

window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();

Second:

We have to create connections like connecting wires to an amplifier or sender to receiver one by one.

Create and AudioContext
Give the AudioContext buffered content to create a full SOURCE
Connect the SOURCE to the GAIN
Connect GAIN to OUTPUT for Simple Audio
or
SOURCE to EFFECT, EFFECT to GAIN and GAIN to OUTPUT

Process:

* SRC –> GAIN –> OUTPUT

* SRC –> EFFECT –> GAIN –> OUTPUT


More…

I will be documenting my high level tasks for the purpose of understanding but these things will not need to be done as a library with everything in place will be the outcome of all of this.

If you wish to understand it all read the next posts [ Read On >> ]

If you wish to dive in and only want to implement this one functionality without improving on it [ Skip Ahead >> (Coming Soon) ]

September 21, 2015 / Danii Oliver

On-Boarding to ReactJS

Terminal: npm – -version
(if no version number)
Install nodes from https://nodejs.org/en/
(will install node and npm at root down)
(( if VM or Virtual Box is needed speak with an expert ))

Go to … and add each to your chrome
https://chrome.google.com/webstore/detail/react-detector/jaaklebbenondhkanegppccanebkdjlh
https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi

Go to Facebook REPO for react scripts needed
https://facebook.github.io/react/downloads.html

Go To … to learn about React-Tools
https://www.npmjs.com/package/react-tools

Install react tools directly to working directory by navigating to working directory in Terminals or type cd and drag directly to the command line.

Once in directory type:
sudo npm install -g react-tools
enter password
npm build for react which transforms the JSX is now installed.

To build when ready for deployment type
jsx src/ build/ (( or jsx the top of the directory with the JSX javascript the build/))

!!! During Development use
https://fb.me/react-0.13.3.min.jshttps://fb.me/JSXTransformer-0.13.3.js
in head tags to use browser transformer to test. build/ when ready to deploy.


STANDARD TEMPLATE FOR REACT DEVELOPMENT


Click here to download the full text and the html with script tags >> react-environment-setup


JSX reference
http://facebook.github.io/react/docs/tooling-integration.html#jsx

*To view development renderings view exclusively in Firefox!!

Click here to download the full text and the html with script tags >> react-environment-setup

Follow

Get every new post delivered to your Inbox.

Join 192 other followers

%d bloggers like this: