SWFObject Interview Questions & Answers

5 avg. rating (100% score) - 1 votes

SWFObject Interview Questions & Answers

If you are an expert in SWFObject then this is for you. Let us know if you looking for a job change? Then do not worry, we’ve a right answer for your job interview preparation. If you are preparing for SWFObject job interview then go through Wisdomjobs interview questions and answers page. SWFObject is used in including Flash content onto web pages. This is included in JavaScript library as a small file to embed the features. Very simple to understand the background on the functionality of SWFObject. There are certifications to improve the visibility in interview. Good knowledge on the SWFObject are must to crack the job. Below are the SWFObject interview questions and answers which makes you comfortable to face the interviews:

SWFObject Interview Questions

SWFObject Interview Questions
    1. Question 1. Do You Know Why Is The "settings..." Option In The Flash Player Context Menu Grayed Out?

      Answer :

      Flash Player's "Settings" panel has a minimum size of 214x137 pixels. If your embedded SWF is smaller than 214x137, Flash Player will not have enough room to display the settings panel, and will make the "Settings..." menu item inactive (grayed out). If you would like the "Settings..." menu item to be clickable, you will need to ensure your SWF is at least 214px wide by 137px tall.

      This size constraint also applies to the Express Install dialog.

    2. Question 2. Explain Why Can We See Memory Usage Increase On Every Page Refresh In Internet Explorer?

      Answer :

      Recently the team from Anychart.com discovered the reason behind a long standing apparent Flash Player 9/10 memory leak when a user refreshes the page. This bug affects HTML pages which has a swf embedded on the page (whether using SWFObject or not) when viewed in IE 6/7/8. The reason for the bug was actually not the Flash player itself, but the Skype IE plug-in.

    3. Question 3. Tell Me Why Does Internet Explorer 6 And 7 Show The Error Message J.parentnode Is Null Or Not An Object?

      Answer :

      This happens when the SWFObject library (versions 2.0 or 2.1) are included more than once on the same web page. To avoid this, make sure that your swfobject.js file is only included once. SWFObject 2.2 will include a fix for this issue.

    4. Question 4. Tell Us Why Does Firefox Report Permission Denied To Call Method Location.to String In The Error Console?

      Answer :

      When you create an iframe on a page that resides on a different domain than the parent page you will get this error which is caused by the Flash plug-in.

    5. Question 5. Do You Have Any Idea Why Do Stage.stagewidth And Stage.stageheight Return 0 In Firefox Or Internet Explorer When Using Dynamic Publishing?

      Answer :

      When using the dynamic publishing method in Internet Explorer or Firefox on Mac stage.stageWidth and stage.stageHeight might initially return 0 (note that for Internet Explorer the stage size will be available on first load, however when reloading or revisiting a page it will initially be 0).

      The solution is to define a resize handler in your ActionScript code. The Flash Player team was obviously aware of this issue and therefore the Flash Player will keep on triggering the stage.resize event until it receives its actual width and height.

      An AS3 example:

      stage.addEventListener(Event.RESIZE, resizeHandler);
      stage.dispatchEvent(new Event(Event.RESIZE)); // force stage resize event for normal cases 
      function resizeHandler(event:Event):void {
      if (stage.stageHeight > 0 && stage.stageWidth > 0) {
      stage.removeEventListener(Event.RESIZE, resizeHandler); // only execute once
      // your initialization code here
      }
      }

    6. Question 6. Why Would Not Flash Player 10 Display My Swf File?

      Answer :

      A new security feature in Flash Player 10 causes SWF's not to be displayed when a HTTP server sends the following response: Content-Disposition: attachment.

    7. Question 7. How To Know Which Flash Player Version Is Installed And Which Version Is Detected By Swfobject?

      Answer :

      The Flash Player version as installed by:

      Firefox 3: Type "about:plugins" in the location/address bar and look for the "Shockwave Flash" entry

      Safari 3: Click "Help > Installed Plug-ins" in the main menu and look for the "Shockwave Flash" entry 

      The Flash Player version as detected by:

      SWFObject 2

      Flash (using HTML `object` element only)

      Flash (using HTML `embed` element only)

    8. Question 8. Where Can We Find Older Flash Player Versions, E.g. To Test Adobe Express Install?

      Answer :

      Flash Player uninstaller

      Archived Flash Player versions for testing purposes

      The latest released version of Flash Player 

      When you run an archived Flash Player on Intel-based Macintosh computers please keep in mind that there are two types of Mac installers:

      A universal binary installer includes both a version of Flash Player that runs natively on Intel-based Macs and a PowerPC version.

      PowerPC installers require browsers to run in Rosetta, which is a special mode that runs older legacy PowerPC applications on Intel-based Macs. You can force a browser to open in Rosetta by opening the info window in Finder (clicking the app and selecting "Get Info"), then ticking the "Open in Rosetta" box. New versions of Safari and Opera no longer support this, but Firefox 3 does.

    9. Question 9. How To Disable Flash Player Or Javascript?

      Answer :

      For static publishing and dynamic publishing you can enable/disable your Flash Player by:

      Internet Explorer 7: Menu: Tools > Internet Options, Program Tab, click button: Manage add-on, Filters, Add-ons that run without requiring permission, select Shockwave Object, click Enable/Disable button at bottom, close and restart browser

      Firefox 3: Menu: Tools > Add-ons, Plugins tab, Select Shockwave Flash, enable/disable

      Safari 3: Menu: Safari > Preferences, Security tab, Web content: check Enable plug-ins

      Opera 9.5: Menu: Opera > Quick Preferences > Enable Plug-Ins 

      For dynamic publishing you can enable/disable JavaScript by:

      Internet Explorer 7: Menu: Tools > Internet Options, Security tab, click icon: Internet, click button: Custom Level, scroll to the "Scripting" section of the list, click radio button Disable under Active scripting, close and restart browser

      Firefox 3: Menu: Firefox > Preferences, Content tab, Check Enable JavaScript

      Safari 3: Menu: Safari > Preferences, Security tab, Web content: check Enable JavaScript

      Opera 9.5: Menu: Opera > Quick Preferences > Enable JavaScript.

    10. Question 10. Do You Know Why Does Firefox Load My Swf Twice?

      Answer :

      Firefox 3 has a known issue that sometimes causes a swf to be 'double initialized'. The problem appears to be fixed in their codebase, but has not been released yet. See the following bugs for more details: bug 438830 and bug 445599.

      Or, if you have "Disable cache" selected in your Firefox Web Developer Toolbar extension a double load will occur.

    11. Question 11. Why Do We See A Dotted Border Around My Swf When Using Firefox 3 On Windows And Wmode Transparent Or Opaque?

      Answer :

      Firefox 3 on Windows using wmode transparent or opaque introduces a new default style for the object element; it treats it like an active link.

      This Firefox implementation deviates from Firefox 3 on Mac, previous Firefox versions on Windows and the default style for the embed element, so it is therefore likely to be a Firefox bug.

      The following style rule in the head of your web page should solve this issue:

      <style type="text/css" media="screen">

      object { outline:none; }

      </style>

    12. Question 12. Tell Me Why Can Not I See Flash Content In Firefox 3?

      Answer :

      Do you have the Adblock extension installed? In Firefox 3 Adblock incorrectly blocks Flash content (the object tag only, so that's why content embedded with SWFObject 1.5 does work, because it uses the embed tag), even if your entire page is whitelisted.

      In this case just disable Flash block (by disabling the extension, don't use Adblock's disable feature, because then it still won't show Flash content). Please note that the development of and support for Adblock has been discontinued.

    13. Question 13. Please Tell Me Why Does Not The Salign Param Element Work In Firefox Or Safari?

      Answer :

      When using static publishing ensure that you have duplicated your nested param elements for both object elements.

      Also the order of certain param elements are important, e.g. the scale parameter should always be declared BEFORE the salign parameter.

    14. Question 14. Tell Me Do Swfs Embedded With Swfobject 2 Display In The Sony Ps3 Or Nintendo Wii Web Browsers?

      Answer :

      The Opera web browser on Nintendo Wii displays both Flash content embedded with static and dynamic publishing. Please note that the Wii currently only supports Flash Player 7 content and that Adobe Express Install is not supported.

      The Netfront browser on Sony PSP and older versions of PS3 will only display Flash content when using static publishing. The reason for this is that it's JavaScript support is extremely limited, so that the SWFObject 2 script will never be executed. Please also note that it currently only supports Flash Player 6 content and that Adobe Express Install is not supported.

    15. Question 15. How To Avoid That Extra Whitespace Is Created Underneath My Swf?

      Answer :

      When using dynamic publishing and a strict HTML DOCTYPE Firefox, Safari and Opera may create a few pixels whitespace underneath your Flash movie.

      To avoid this make sure that your object element is set as a block level element, which can be achieved with the following CSS style rule:

      <style type="text/css" media="screen">

      object { display:block; }

      </style>

    16. Question 16. How To Pass Uris Or Html Code As A Value Using Flashvars?

      Answer :

      Special characters and the symbols = and & cannot directly be used inside flashvars values (the latter because they are used to stack the flashvars themselves).

      You can workaround this issue by escaping these characters before passing them as flashvar values.

      An example:

      encodeURIComponent("&trade") will become %26trade

      The values will be available in your swf already unencoded, so no unescaping is needed inside your swf.

      Note that encodeURIComponent is not available in all browsers, but is available in all of the common modern versions. If you need full backwards compatibility, you can use escape() instead, but note that escape() does not work well with double-byte characters (like Chinese).

      You can also escape these characters manually by using:

      %3D instead of =

      %26 instead of &

    17. Question 17. How To Avoid Active Server Pages Error Asp 0139 When Using Static Publishing And Microsoft Iis?

      Answer :

      Microsoft IIS's ASP interpreter incorrectly doesn't allow a page with nested <object> tags, resulting in the following error message:

      Active Server Pages error 'ASP 0139'

      Nested Object

      /yourWebpage.html, line XX 

      An object tag cannot be placed inside another object tag.

      You can avoid this error by using one of the following workarounds (note: which workaround will be best will depend on your specific situation):

      • Configure IIS not to serve .htm and .html files as ASP
      • Use a server-side include
      • Create the object tags dynamically, the 'Update - The Dynamic Approach'

    18. Question 18. How To Prevent Internet Explorer From Showing An Error Message When Using External Interface And Swf That Is Inside A <form> Tag?

      Answer :

      This technote provides additional info and two solutions.

      It is preferred to use the first solution that applied to SWFObject 2 embedding looks like the following:

      function fixReference() {

      window["mySwfId"] = document.forms[0]["mySwfId"];

      }

      swfobject.addDomLoadEvent(fixReference);

    19. Question 19. Can You Please Explain How To Fix A "line 56: Out Of Memory" Error, When Unloading A Page In Internet Explorer Using Earlier Versions Of Flash Player 9 And Multiple Swfs Using Externalinterface?

      Answer :

      This issue was introduced with the release of Flash Player 9, and is fixed in recent versions of Flash Player 9. You can fix it for the earlier versions by adding the following JavaScript code in the head of your (X)HTML page.

      <!--[if IE]>
      <script type="text/javascript">
      function fixOutOfMemoryError() {
      __flash_unloadHandler = function() {};
      __flash_savedUnloadHandler = function() {};
      }
      window.attachEvent("onbeforeunload", fixOutOfMemoryError);
      </script>
      <![endif]-->
       
       

    20. Question 20. Do You Know Why Does Not Fscommand Work In Internet Explorer With Dynamic Publishing?

      Answer :

      A In order to make fscommand work in Internet Explorer Adobe recommends to add a block of VBScript to capture and forward the FSCommand calls to JavaScript. However VBScript doesn't work anymore when a Flash movie is inserted using innerHTML or outerHTML, as SWFObject's dynamic publishing method does.

      Fortunately you can also use JavaScript instead of VBScript to catch the fscommand calls. A small downside is that it uses proprietary attributes (which, again, wrapped in conditional comments will keep your code valid).

      E.g. the following block of VBScript code:

      <SCRIPT LANGUAGE=VBScript>
      on error resume next
      Sub myCom_FSCommand(ByVal command, ByVal args)
      call myCom_DoFSCommand(command, args)
      end sub
      </SCRIPT>
      Can be replaced with:
      <!--[if IE]>
      <script type="text/javascript" event="FSCommand(command,args)" for="myCom">
      myCom_DoFSCommand(command, args);
      </script>
      <![endif]-->

    21. Question 21. Tell Me How To Prevent Internet Explorer From Crashing And Showing An "operation Aborted" Error When A <base> Tag Is Defined?

      Answer :

      Including a closing </base> tag will prevent this bug in Internet Explorer being triggered. Because for HTML 4 compliant pages (a closing base tag is forbidden under HTML 4), you could use Internet Explorer conditional comments to keep your HTML valid and still include a closing base tag for HTML 4 documents:

      <base href="http://www.wisdomjobs.com/"><!--[if IE]></base><![endif]-->

    22. Question 22. Please Explain Why Does Swfobject.getflashplayerversion() Sometimes Incorrectly Report The Installed Flash Player Version?

      Answer :

      In the past years there have been several occasions where a Flash Player didn't expose the right version number externally - as can be retrieved with JavaScript -, caused by corrupt Flash Player Mac OS X installers, affecting Firefox, Opera and Safari on Mac OS X, and also all JavaScript detection scripts, including SWFObject 2, SWFObject 1.5, UFO and the Adobe Flash Player Detection Kit.

      Known erroneous versions are (major.minor.release version):

      9.0.47 exposes 9.0.19

      8.0.24 exposes 8.0.23

      9.0.115 exposes either 9.0.47 or 9.0.64 (Note: only Adobe Express Install installers, affecting Firefox on Mac OS X only)

    23. Question 23. Tell Me Why Do Not I See Flash Content In Internet Explorer On Windows While I Do Have The Required Minimal Flash Player Version Installed?

      Answer :

      When an install gets corrupted (very often caused by corrupt installers) it is impossible to read the Flash Player version number externally using scripting languages. When using dynamic publishing this results in the display of alternative content, with static publishing we let the object element do its job (it decides whether to show Flash content or alternative content based on its built-in MIME type mechanism) which results in the display of Flash content.

    24. Question 24. How To Create A Swf That Will Encompass 100% Of The Browser Window?

      Answer :

      The following technique is also known as Full Browser Flash:

      Set both the width and height of your SWF to 100% in your SWFObject definition

      Include CSS to get rid of any default margins/padding and set the height of the html element, the body element and the entire chain of block level HTML elements that your SWF will be nested in to 100%, because Firefox (or: any Gecko based browser) in standards compliant mode (or: using a valid DOCTYPE) interprets percentages in a very strict way (to be precise: the percentage of the height of its parent container, which has to be set explicitly).

      Manage the scaling and alignment of your SWF and the positioning of your SWF's elements, within your ActionScript code, e.g.:

      stage.scaleMode = StageScaleMode.NO_SCALE;
      stage.align = StageAlign.TOP_LEFT;
      stage.addEventListener(Event.RESIZE, resizeHandler);
      function resizeHandler(event:Event):void {
      // center stuff
      }

    25. Question 25. What Is Swffit?

      Answer :

      SWFFit (formerly known as FitFlash) is a JavaScript library used to resize Flash movies according to the browser window size, keeping it accessible independent of the screen resolution.

      SWFFit primarily configures the web browser to display scroll bars when content exceeds the browser window size. It can also be used to dynamically resize the Flash movie size. It is used together with SWFObject.

    26. Question 26. What Is Swfaddress?

      Answer :

      SWFAddress is a JavaScript and ActionScript library that allows Flash websites to support deep linking, and can automatically integrate with SWFObject.

    27. Question 27. Explain Swfobject Features?

      Answer :

      SWFObject also includes a few utility functions within its API to retrieve Flash Player related information, such as checking whether a specific version of Flash Player is installed, and a few DHTML utilities to help work with the DOM. Because of this, the most common reasons Flash Website developers turn to external JavaScript frameworks such as jQuery or Prototype are satisfied internally, giving developers fewer reasons to add additional JavaScript libraries to their website.

      The library can also be used to integrate Flash Player Express Install into the webpage, allowing users to install the latest Flash Player without leaving the site, although this requires a browser restart.

    28. Question 28. Explain Swfobject Usage?

      Answer :

      SWFObject provides a reliable method of embedding Flash content into a webpage by internally handling the various practices that one must follow in order for different web browsers to display Flash content correctly, and isolating them from the web designer.

      The developer may interface with the library in a standardized manner, the minimum being a single line of JavaScript code. Therefore even inexperienced web designers without knowledge of the ideal HTML code to embed Flash content, can easily insert Flash content into web pages, and have them reliably work for the widest possible audience (excepting those with JavaScript disabled).

      Flash content inserted using SWFObject will also work on devices that support JavaScript execution (and Flash Player), such as the Wii, PlayStation 3 and Nokia N800, unlike the PlayStation Portable.

    29. Question 29. What Is Swfobject?

      Answer :

      SWFObject (originally FlashObject) is an open-source JavaScript library used to embed Adobe Flash content onto Web pages, which is supplied as one small JavaScript file.

      The library can also detect the installed Adobe Flash Player plug-in in all major web browsers, on all major operating systems (OS), and can redirect the visitor to another webpage or show alternate HTML content if the installed plug-in is not suitable.

Flash Tutorial

All Tutorials

All Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Flash Tutorial