calling a function from html (problem)

Posted on 2006-05-09
Last Modified: 2010-04-03
im callin a function from html

function redirect(frame) {
      if (this._currentframe != frame) {

the if condition doesnt work. can anyone look into it? i want the actions to only be performed if the parameter "frame" (passed by the html) is NOT the same as the currentframe.
Question by:mrsam007
    LVL 2

    Accepted Solution

    function redirect(frame:Number) {
          trace("this._currentframe = " + this._currentframe);
          trace("frame = " + frame);
      if (this._currentframe != frame) {
                trace("this._currentframe and frame are NOT equal.");
                //Any other actions you choose...
                trace("this._currentframe and frame ARE equal.");

    That’s the actionscript.

    If you're having trouble with the communication between the page and the swf, the JavaScript to swf communication is explained here:

    Hope this helps.
    LVL 39

    Expert Comment

    Hi, I'm not sure I understand the question.
    You have the method in your swf file and you're calling that method from the html?
    how are you doing that? why are you doing that?
    why not just handle it in the flash.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Dreamweaver CC 2015

    Adobe Dreamweaver Creative Cloud is used by web designers and front-end developers and allows you to visualize your site in real-time as you code. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Suggested Solutions

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now