IT Community - Software Programming, Web Development and Technical Support

Flash Tips & Tricks

This is a discussion on Flash Tips & Tricks within the Flash Actionscript Programming forums, part of the Web Development category; How to make the SWF file transparent to add a background picture directly in HTML? Yes, a background picture is ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Display Modes
  #21  
Old 03-05-2008, 10:42 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

How to make the SWF file transparent to add a background picture directly in HTML?

Yes, a background picture is possible. To do this, just add the following line of code to the object section of your HTML code:

<param name=wmode value=transparent>

in ther embed section of your HTML code you must add:
wmode="transparent"

Regards,

A.Ramesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22  
Old 03-06-2008, 05:55 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

We have a design with animated MovieClip’s for buttons. When the user rolls the mouse over the MovieClip it is told to play(). That much works fine but we would like to play that same animation backwards when the user moves the mouse off the MovieClip.

Here’s the gist of a solution: create a onRollOut function that creates an onEnterFrame function to tell the timeline to gotoAndStop on the ( _currentframe - 1 ). Continually test to see if _currentframe == 1. If it does then delete the onEnterFrame so that it doesn’t waist processing cycles.

Regards,

A.Ramesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23  
Old 03-07-2008, 07:10 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Relative URLs are not referenced correctly in a Flash movie

If you are going to use relative URLs, then you should use the base attribute in the HTML <OBJECT> and <EMBED> tag to enforce the base location from which the URL loads. This prevents confusion about the location to which relative links are relative.
The base attribute in <OBJECT> and<EMBED> tags

The base attribute specifies the base directory or URL used in resolving all relative path statements in the Flash Player movie. This path can be absolute or relative where the default value is "." or the location of the SWF file.

Note: When you use the Active Content fix provided by Dreamweaver, the base attribute can be added to the generated code by including base and desired path into the arguments passed to AC_FL_RunContent().

The following is a very brief sample of code that uses a specific sample base:

HTML Code:
<script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0', 'width','600','height','500','title','myMovie','src','myMovie','quality','high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','movie','test_CoilGalleryApp','base', 'http://www.example.com/pages/' ); //end AC code</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="500" title="myMovie"><param name="movie" value="myMovie.swf"><param name="quality" value="high"><param name="base" value="http://www.example.com/pages/"><embed base="http://www.example.com/pages/" src="myMovie.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="500"></embed></object></noscript>
Regards,

A.Ramesh

Last edited by aramesh : 03-07-2008 at 07:12 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24  
Old 03-07-2008, 10:04 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Bitmaps shift in Macromedia Flash

Issue

Bitmaps can appear different in the Macromedia Flash editor than in the SWF or in the browser when viewed on a machine with display set to 32-bit color. Sometimes they can also "jump" and appear to change position on the stage.

* Some bitmaps shift approximately 1 pixel when Flash reaches a keyframe. This may happen as part of an alpha tween, although the screen location has not changed.
* The image looks "banded" or aliased in the browser, even if the bitmap quality settings are set to "Best"

Reason

Flash occasionally exhibits odd behavior calculating the position of the bitmap on screen. This can cause the image to shift.

Solution

There are several simple solutions that will resolve this problem.

* In some cases, turning off "Allow Smoothing" in the Library's Bitmap Properties dialog box will eliminate the issue.
* Convert the bitmap to individual pieces using Modify > Break Apart. If the bitmap is inside a symbol, edit the symbol and break it apart there.
* Resizing the image slightly often cures this problem. Use the scale tool to resize the image by a tiny amount.
* If the jumping occurs during an alpha tween, try a different alpha value in either the start or finish of the tween. Instead of using 100% alpha, use 99% instead. Similarly, use 1% instead of 0%, if necessary.
__________________
A.Ramesh
Failure is not the End…it is your stepping stone to success!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25  
Old 03-07-2008, 11:02 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Changing skin properties in a subcomponent
There is lot of ways to change the skin properties. But if You use the Following method this will improve your object oriented knowledge.

If a component does not directly support skin variables, you can create a subclass of the component and replace its skins. For example, the ComboBox component doesn't directly support skinning its drop-down list, because the ComboBox component uses a List component as its drop-down list.

If a component is composed of subcomponents, the subcomponents are identified in the component's entry in the Components Language Reference.

To skin a subcomponent:

1. Follow the steps in Editing component skins in a document, but edit a scroll bar skin. For this example, edit the ScrollDownArrowDown skin and give it the new name MyScrollDownArrowDown.
2. Select File > New and create a Flash document.
3. Select File > Save and give the file a unique name, such as MyComboTest.fla.
4. Drag MyScrollDownArrowDown from the theme library above to the library of MyComboTest.fla.
This adds the symbol to the library, but doesn't make it visible on the Stage.
5. Select Insert > New Symbol and give the symbol a unique name, such as MyComboBox.
6. Select the Export for ActionScript check box and click OK.
Export in First Frame should be automatically selected; if it is not, select it.
7. Enter the following code in the Actions panel on Frame 1 of the MyComboBox symbol: #initclip 10
import MyComboBox
Object.registerClass("ComboBox", MyComboBox);
#endinitclip

8. When you finish editing the symbol, click the Back button at the left side of the information bar at the top of the Stage to return to document-editing mode.
9. Drag a ComboBox component to the Stage.
10. In the Property inspector, enter as many Label parameters as necessary for the vertical scroll bar to appear.
11. Select File > Save.
12. Select File > New and create a new ActionScript file.
13. Enter the following code: import mx.controls.ComboBox
Code:
import mx.controls.scrollClasses.ScrollBar
class MyComboBox extends ComboBox{
    function getDropdown():Object{
        var oldName = ScrollBar.prototype.downArrowDownName;
        ScrollBar.prototype.downArrowDownName = "MyScrollDownArrowDown";
        var r = super.getDropdown();
        ScrollBar.prototype.downArrowDownName = oldName;
        return r;
    }
}

14. Select File > Save and save this file as MyComboBox.as.
15. Return to the file MyComboTest.fla.
16. Click a blank area on the Stage and, in the Property inspector, click the Publish Settings button.
17. Click the ActionScript Version Settings button.
18. Click the Add New Path (+) button to add a new classpath, and select the Target button to browse to the location of the MyComboBox.as file on your hard disk.
19. Select Control > Test Movie.
__________________
A.Ramesh
Failure is not the End…it is your stepping stone to success!

Last edited by aramesh : 03-10-2008 at 04:38 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26  
Old 03-11-2008, 04:45 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Default Re: Flash Tips & Tricks

SWFs with high frame rates may slow system performance

Movies that have been assigned a high frame rate (30-120 frames per second) may cause system performance to slow. This occurs when the Macromedia Flash Player 5 (or above) is used to display the movie.

Because Flash 5 attempts to achieve higher frame rates than previous players. As a result, the system may be forced to work too hard to achieve this higher frame rate. This can reduce overall system performance.

To prevent this, set the frame rate of the movie close to the actual target rate. Use 15 to 18 FPS (Frames Per Second) as a guideline.
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27  
Old 03-15-2008, 03:20 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

Using FScommands, externalInterface or JavaScript with IFRAME tags or DHTML layers

In order for FSCommand, externalInterface or JavaScript to work from a Flash movie in an IFRAME tag or DHTML layer, the browser itself must support these calls.

FSCommand with IFRAME was first supported in Internet Explorer 4 and Netscape 6. However, Netscape 6 support of the IFRAME tag was very limited.

ExternalInterface is supported by Explorer 5.0 and later, Firefox 1.0 and later, Mozilla 1.7.5 and later, Netscape 8 and later, and Safari 1.3 and later.
__________________
A.Ramesh
Failure is not the End…it is your stepping stone to success!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28  
Old 03-17-2008, 07:31 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Default Re: Flash Tips & Tricks

SWFObject doesn't work! Help!

A: Here are some general trouble shooting techniques to help you narrow down your issue:


1. if your swf doesn't show up on your website:

a. are you sure you have the required Flash Player version installed to view your page? You can check your installed Flash Player version with this page.

b. Do you get any Javascript errors? Try fixing those first.


2. Some people can see my swf, but other people using Internet Explorer only see the alternate content.
a. They may have a corrupt install of their Flash Player. Have them run the Adobe Flash Player uninstaller, and then reinstall the latest plugin.
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29  
Old 11-13-2008, 08:56 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Flash Tips & Tricks

To hide the background and borders of specific component instances in a single step:
For example TextInput and TextArea,
1. Open the document text.fla.
2. Add an instance of TextInput and TextArea and name it as "textinput01" and "textarea01".
3. Add the following code to the ActionScript file just created:

import mx.controls.TextInput;
import mx.controls.TextArea;

TextInput.prototype.setBackground = function(showIt:Boolean):Void{
this.border_mc.setVisible(showIt);
}
TextArea.prototype.setBackground = function(showIt:Boolean):Void{
this.border_mc.setVisible(showIt);
}

textinput01.setBackground(false);
textarea01.setBackground(false);
textinput01.text = "Some Text";
textarea01.text = "Some Text";

4. Testing the movie will result in the total absence of component backgrounds and borders from the layout.

Regards
A.Ramesh
__________________
A.Ramesh
Failure is not the End…it is your stepping stone to success!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30  
Old 01-04-2009, 09:03 PM
hkp819 hkp819 is offline
D-Web Trainee
 
Join Date: Dec 2008
Posts: 43
hkp819 is on a distinguished road
Default Re: Flash Tips & Tricks

These are the very useful information thanks for sharing it.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 85 01-08-2009 01:25 AM
SAP Tips & Tricks leoraja8 Operating Systems 0 03-29-2008 01:11 AM
PHP Tips and Tricks Sabari PHP Programming 20 12-18-2007 06:26 AM
.NET tricks & Tips Karpagarajan VB.NET Programming 1 04-23-2007 09:17 AM
SEO Tips & Tricks spid4r Search Engine Optimization 0 03-09-2007 12:03 AM


All times are GMT -7. The time now is 07:49 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0