All Media XML Portfolio

All Media XML Portfolio

All Media XML Portfolio

This is an all purpose portfolio that will cover all your media needs in an elegant and professional way.

[ FEATURES ]

– XML driven content
– FLASHVARS support ( for the location of the XML file )
– resizable
– unlimited number of projects
– suppport for: videoyoutubeanimated swfimagesmp3
– change the colors 
– text HTML formatting  
– text supports hyperlinks
– smart scrollbar
– the panel can be set left or right
– OOP code
– DOCUMENTATION / HELP FILE

[ PACKAGE ]

[1] DOCUMENTATION    here you’ll find the necessary info on how to change the file
[2] Source Code    here you’ll find the files to edit the template yourself ( you need some programming skills )
[4] Deploy    here you’ll find all the files you need to have on your server

[ LINK ]

Advertisements

Loading External Fonts in Actionscript 3.0

First step:

– create a flash file ( font.fla) linked to a actionscript class file (Font.as).
– copy and paste the code bellow in Font.as

package
{
import flash.display.MovieClip;

public class CustomFont extends MovieClip
{
[Embed(source='/font.ttf', fontName='CUSTOM', mimeType='application/x-font')]
public static var CUSTOM:Class;
}
}

– compile the files, now you should have a font.swf in your folder.

Second step:

– create a flash file ( main.fla) linked to a actionscript class file (Main.as).
– copy and paste the code bellow in Main.as

package
{
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;
import flash.text.Font;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

public class Tutorial extends MovieClip
{
public function Tutorial()
{
var $loader:Loader = new Loader();
$loader.contentLoaderInfo.addEventListener(Event.COMPLETE, Complete, false, 0, true);
$loader.load(new URLRequest("font.swf"));
}

private function Complete($e:Event):void
{
var FontLibrary:Class = $e.target.applicationDomain.getDefinition(getQualifiedClassName($e.target.content)) as Class;
Font.registerFont(FontLibrary.CUSTOM);

ShowText();
}

private function ShowText():void
{
var $tf:TextField = new TextField();
$tf.defaultTextFormat = new TextFormat("CUSTOM", 60,0x000000);
$tf.width = 500;
$tf.embedFonts = true;
$tf.text = "HELLO WORLD";
addChild($tf);
}
}
}

– compile the files and you should have your text with your custom font.