Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Friday, April 17, 2009

Set TextField horizontal scroll to initial position

If you want to set the position of horizontal scroll position inside TextField, you can use TextField.scrollH.

Let's say I am typing in the input TextField and I typed beyond the width of TextField. You will see the last characters visible you typed. Now due to some other event, say user clicks on other than this TextField, focus is changed to some other object than this TextField, you may want to reset the scroll position of TextField to starting characters in it.
You will use :
TextField.scrollH = 0;

This will set the horizontal scroll of TextField to 0 and hence showing the starting characters in TextField.

Wednesday, April 8, 2009

Default ContextMenu Items on Flash TextField

Is there any way to hide default context menu items on Flash TextField? Some one will try to answer with ContextMenu.hideBuiltInItems() function, but this function does not really work with Flash TextField. It does not hide the built in items.

So following code does work but not as expected ::

var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();

var txt:TextField = new TextField();
txt.contextMenu = myContextMenu;
addChild(txt);

Now if you right click on TextField then you will see that you can see all the built in item. Any one knows why?

Saturday, May 31, 2008

Identify all the key strokes in Flash IDE Environment

By default, when you press some key in Flash IDE Environment, in ActionScript you will not be able to handle DELETE key stroke as that is shortcut key in Flash IDE.

To handle such key strokes in ActionScript, while running an application in Flash IDE, go to swf's Control menu and tick 'Disable Keyboard Shortcuts'. Now ActionScript will listen all the key events which are shortcuts in Flash IDE Environment.

- Naresh Khokhaneshiya

Thursday, May 15, 2008

Adobe Flash Player 10 Beta Released

Adobe® Flash® Player 10, code-named "Astro," introduces new expressive features and visual performance improvements that allow interactive designers and developers to build the richest and most immersive Web experiences. These new capabilities also empower the community to extend Flash Player and to take creativity and interactivity to a new level.

This public prerelease is an opportunity for developers and consumers to test and provide early feedback to Adobe on new features, enhancements, and compatibility with previously authored content. Once you’ve installed Flash Player 10 beta, you can view interactive demos. You can also help make Flash Player better by visiting all of your favorite sites, making sure they work the same or better than with the current player.

Key New Features

3D Effects - Easily transform and animate any display object through 3D space while retaining full interactivity. Fast, lightweight, and native 3D effects make motion that was previously reserved for expert users available to everyone. Complex effects are simple with APIs that extend what you already know.

Custom Filters and Effects - Create your own portable filters, blend modes, and fills using Adobe® Pixel Bender™, the same technology used for many After Effects CS3 filters. Shaders in Flash Player are about 1KB and can be scripted and animated at runtime.

Advanced Text Layout - A new, highly flexible text layout engine, co-existing with TextField, enables innovation in creating new text controls by providing low-level access to text offering right-to-left and vertical text layout, plus support for typographic elements like ligatures.

Enhanced Drawing API - Runtime drawing is easier and more powerful with re-styleable properties, 3D APIs, and a new way of drawing sophisticated shapes without having to code them line by line.

Visual Performance Improvements – Applications and videos will run smoother and faster with expanded use of hardware acceleration. By moving several visual processing tasks to the video card, the CPU is free to do more.

See the release notes for more information regarding this prerelease technology.

Feature Demos and Videos

Flash Player 10 Feature Tours and Demos

Interactively explore Flash Player 10 via demonstrations of the new 3D effects, custom filters, text layout, and interactive Inverse Kinematics features. If you want to know more about how things work, check out the collection of feature tour videos, hosted by members of the Flash Player team. For those that have created their own filters, the Pixel Bender demo is your chance to see your filter running live! (Demos require Flash Player 10.)

* Release versions of Flash Player 9 are now available from the Flash Player Download Center on Adobe.com.

Enjoy the great features of ASTRO !

Naresh Khokhaneshiya

Tuesday, May 13, 2008

DataProvider.getItemIndex() function does not work in proper manner

In ActionScript 3.0, DataProvider.getItemIndex() method is not working properly. It mostly returns -1, as an indicator of 'Item not found' in the DataProvider.

Following code illustrates the problem ::

import fl.controls.ComboBox;
import fl.data.DataProvider;

var cb:ComboBox = new ComboBox();
this.addChild(cb);

var dp:DataProvider = new DataProvider();
dp.addItem({label:"Ashvin Savani"});
dp.addItem({label:"Naresh Khokhaneshiya"});
dp.addItem({label:"Jignesh Dodiya"});
dp.addItem({label:"Alpesh Vaghasiya"});

cb.dataProvider = dp;

//get index of item 'Naresh Khokhaneshiya'
var index:int = dp.getItemIndex({label:"Naresh Khokhaneshiya"});

//following line outputs :: index : -1, which is totally wrong.
trace("index : " + index);

//set the item selected. Obviously it will give runtime error.
cb.selectedIndex = index;

Naresh Khokhaneshiya

Friday, May 9, 2008

Flash Player 9 does not support Ordered List

Surprisingly Flash Player 9 does not support Ordered List <ol> tag for TextField.htmlText property. It gives output same as Unordered List <ul>. Also it does not support “type” attribute of <ul> tag.

TextField.htmlText supports List Item

  • tag but that is also limited. It does not support “type” attribute of
  • tag. It supports only “circle” as a type of
  • tag.

    Flash Player 9 supports following HTML tags :

    http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000922.html

    Hope that Flash Player 10 will support <ol> tag :)

    Naresh Khokhaneshiya

  • Tuesday, July 17, 2007

    Flash Media Server and NetStream Publish

    When we use NetStream.publish method in append mode for any flash video file, the metadata is not updated in that flash video file. Actually it remains same as whatever was previously while the stream was recorded at the first time in recording mode.

    Here you can find more details on the same ... FMS Release Notes

    Naresh Khokhaneshiya

    Monday, July 16, 2007

    Adobe Flash CS3 Professional - Error

    I found that Adobe Flash CS3 Professional gives following error in IDE ::

    Location : , Line 1

    Description : 5005: Unknown error optimizing byte code.

    Source :

    This is happening when I compile library of size 8+ MB, and that is having 250+ classes !!

    Do any one know what is the exact reason behind this or any solution for this?

    Naresh Khokhaneshiya