How do I attach a class to a movieclip on stage?

Hi all,
I have a Flash movie that is to be the navigation for a web
site, and am using Flash CS3. I have exported it from Photoshop and
have turned the buttons into movieclips on the import. Upon import,
I have several named movieclips on the stage. I want to be able to
attach custom classes to these movieclips so that they have
functionality but haven't figured out how to do this.
My Flash file has a root document class called 'Nav'. I have
a file named 'nav.as' in the same directory as my FLA file. I have
a button onstage named apples_logo, which is an instance of the
library item named ApplesLogo, which is set up for linkage with a
Class Name of ApplesLogo and a base class of
flash.display.MovieClip. Clicking on the "validate class
definition" button in the linkage window indicates that Flash is
finding the actionscript file for this class fine (which is named
'ApplesLogo.as').
When I execute the Flash file, though, I get the error: 1046:
type was not found or was not a compile-time constant: ApplesLogo.
What is going on? I'm expecting the ApplesLogo contstructor method
to be called from my ApplesLogo class. My Nav class is in an
unnamed package and if I create a folder named 'nav' and put my
ApplesLogo.as file into that folder (to try to build my package
structure), I get a message from the class definition validator
button in the Linkage window that says it no longer finds the
ApplesLogo class and will create an empty one for me. I figure one
way or the other this should work, but neither is. What am I
missing?
Thanks for any help you can provide. My very simple source
code is below.

Hello there,
I tried playing around with your code on my machine and like
you I came across the same error you mention above. After some
experimenting I found that if you add the package definition to
your ApplesLogo.as file it works (well, for me it did). Both trace
statements come thru.
Both actionscript classes were in the same folder as the FLA
See if this helps!

Similar Messages

  • In mail, how do I attach pictures or documents as icons that open full size

    in mail, how do I attach pictures or documents as icons that will open full size?

    Try Option + click the picture and choose Show as Icon

  • How to find classtype and class for a material.

    Hi,
    How to find classtype and class for a material.
    which table contains this data.
    Thanks
    Kiran

    Hi Kiran,
    Check below sample code. Use this BAPI which will give all info about the class for the material.
      DATA:      l_objectkey_imp    TYPE bapi1003_key-object
                                         VALUE IS INITIAL.
      CONSTANTS: lc_objecttable_imp TYPE bapi1003_key-objecttable
                                         VALUE 'MARA',
                 lc_classtype_imp   TYPE bapi1003_key-classtype
                                         VALUE '001',
                 lc_freight_class   TYPE bapi1003_alloc_list-classnum
                                         VALUE 'FREIGHT_CLASS',
                 lc_e               TYPE bapiret2-type VALUE 'E',
                 lc_p(1)            TYPE c             VALUE 'P',
                 lc_m(1)            TYPE c             VALUE 'M'.
      SORT i_deliverydata BY vbeln posnr matnr.
      CLEAR wa_deliverydata.
      LOOP AT i_deliverydata INTO wa_deliverydata.
        REFRESH: i_alloclist[],
                 i_return[].
        CLEAR:   l_objectkey_imp.
        l_objectkey_imp = wa_deliverydata-matnr.
    *Get classes and characteristics
        CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
          EXPORTING
            objectkey_imp         = l_objectkey_imp
            objecttable_imp       = lc_objecttable_imp
            classtype_imp         = lc_classtype_imp
    *   READ_VALUATIONS       =
            keydate               = sy-datum
            language              = sy-langu
          TABLES
            alloclist             = i_alloclist
    *   ALLOCVALUESCHAR       =
    *   ALLOCVALUESCURR       =
    *   ALLOCVALUESNUM        =
            return                = i_return
    Thanks,
    Vinod.

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • How can I convert a class file to Exe file

    hai
    How can I convert a class file to Exe file

    Please search the forums before asking questions - this has been answered hundreds (really!) of times.

  • TS3899 Hi. How do I attach more than one document to an email on the iPad, especially if they come from different apps? When writing an email on the iPad there's no option for attachments.

    Hi. How do I attach more than one document to an email originating from my iPad, especially if the documents come from different apps? When starting an email there's no option for attachments, unless you send the document from inside an app like iBook and then you can only send one at a time.

    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
     Cheers, Tom

  • How move code from one class to other?

    I have a .fla file.
    There i have some keyframes with labels.
    On .fla file in property in Class field i adde MyMatching class.
    Also i have main code:
    package
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         public class MyMatching extends MovieClip
              var play_btn:MyButton = new MyButton();
              var kyky:MyTimer;
              public function MyMatching():void
                   welcomeScreen();
              public function welcomeScreen():void
                   stop();
                   trace("working");
                   play_btn.x = 210;
                   play_btn.y = 300;
                   addChild(play_btn);
                   play_btn.addEventListener(MouseEvent.CLICK, goToLevel_1);
              public function goToLevel_1(event:MouseEvent)
                   trace("level 1");
                   play_btn.visible = false;
                   gotoAndStop('Level1Screen');               
                   if (kyky==undefined) {
                        kyky = new MyTimer();
    And i have other class:
    package
         import flash.display.MovieClip;
         import flash.display.Stage;
         import flash.utils.getTimer;
         import flash.text.TextField;
         public class MyTimer extends Stage
              import flash.utils.getTimer;
              var gameStartTime:uint;
              var gameTime:uint;
              var gameTimeField:TextField;
              function mainFunction():void
                   gameTimeField = new TextField();
                   addChild(gameTimeField);
                   gameStartTime=getTimer();
                   gameTime=0;
                   addEventListener(Event.ENTER_FRAME,showTime);
              function showTime(event:Event)
                   gameTime=getTimer()-gameStartTime;
                   gameTimeField.text="You plaing: "+clockTime(gameTime);
              function clockTime(ms:int)
                   var seconds:int=Math.floor(ms/1000);
                   var minutes:int=Math.floor(seconds/60);
                   seconds-=minutes*60;
                   var timeString:String=minutes+":"+String(seconds+100).substr(1,2);
                   return timeString;
    Ho i can play code from class MyTimer in goToLevel_1 function(this function stand in my main class MyMatching) ?
    Thank you.

    First of all your MyTimer class is written wrong and sloppy.
    Why does it extend Stage? The most compact class to extend under the circumstances is Sprite.
    Also, it is very important to get into habit of datatype declarations. Not only it is good practice, in your case good compiler will throw error because although you return String, function doesn't return anything.
    In addition, it is important to declare namespaces like private public and protected inside classes. Not function clickTime():String but private function clockTime():String or public function clickTime():String.
    As for how to show your time elsewhere - you just need to create instnace of it and add it to disaply list:
    var myTimer:MyTimer = new MyTimer();
    addChild(myTimer);
    With that said, your class should look like this:
    package 
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.display.MovieClip;
         import flash.utils.getTimer;
         import flash.text.TextField;
         public class MyTimer extends Sprite
              private var gameStartTime:uint;
              private var gameTime:uint;
              private var gameTimeField:TextField;
              public function MyTimer()
                   gameTimeField = new TextField();
                   addChild(gameTimeField);
                   gameStartTime = getTimer();
                   gameTime = 0;
                   addEventListener(Event.ENTER_FRAME,showTime);
              private function showTime(event:Event):void
                   gameTime = getTimer() - gameStartTime;
                   gameTimeField.text = "You playing: " + clockTime(gameTime);
              private function clockTime(ms:int):String
                   var seconds:int = Math.floor(ms / 1000);
                   var minutes:int = Math.floor(seconds / 60);
                   var timeString:String = minutes + ":" + String(seconds + 100).substr(1, 2);
                   return timeString;

  • How do I attach more than one photo to an email?

    How can I attach more than one photo to an email?

    Yes. With the mail you want to attch the photos to open, tap and hold in the body of the email. One of the Menu ittems will be Insert Photo or Video. Tap that, Select the photo, Tap Use. Repeat for each photo.

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to use the implementation class in propetty pallete

    Hi,
    I am using forms 10g....I have to insert horizontal scroll bar in text item..
    I have only class files instead of jar files ...how cani place the class file instead of jar file...
    How to use the implementation class in property palette to display the PJC
    Thanks,
    Ansaf.

    The Implementation Class must reflect the full name of the class. For instance, if the full class name is : xx.yyy.zz.class_name, then put this in the Implementation Class property of the corresponding item.
    Also, the class must be stored in the equivalent directory structure, so that, in my example: <DEV_HOME>/forms/java/xx/yyy/zz
    Francois

  • How do I attach a form to my Wix website....I tried and everything works EXCEPT payment options.

    How do I attach a form to my Wix website.  I was able to attach a form (through link a document) but the payment options do not work.  Payment options work when I use the preview on the Adobe site.

    Hi,
    Please see this link on how to embed a form into a webpage:
    http://forums.adobe.com/docs/DOC-1991
    Please see this link on how to setup the form for payment collection:
    http://forums.adobe.com/docs/DOC-1632
    Hope this helps, if you still have questions, please write back.
    Thanks,
    Lucia

  • How can I attach j-pegs and other documents to an email unopened and stop each them taking up a whole page of my email ?

    How can I attach j-pegs and other documents to an email unopened and stop each them taking up a whole page of my email ?

    In addition to the last poster's suggestion  -  just so you know, it also depends on the email program the recipient uses as to how they will see any attachments - for instance, when I am using my Yahoo Mail, I am absolutely unable to view any attachment within the browser window - Yahoo forces me to download it; there is no way for me to check it (like a preview) to see if I want to download it or not.
    And, FWIW: the window shown in the screenshot does not show on my version of Mail 5.1 (which is the latest for 10.7.2); the only one similar shows when viewing a message received with an attachment, not while sending one. So that must be a different version.

  • How can I attach a PDF file to an email I am replying to?

    Hi!
    How can I attach a PDF file already saved on my iPad to an existing email I am replying to from my inbox??

    If you have the PDF stored on the iPhone as a separate file you obviously also have a third party app for reading it, so you should be able to e-mail it from there.
    If it's on an existing e-mail, forward the e-mail and just change the contents but include the pdf

  • How can I attach a photo to an email,using Photoshop Elements9,without going through the Revel cloud

    How can I attach a photo to an email using Photoshop Elements 9, without going through the Adobe Revel cloud?

    Adobe user wrote:
    I'm using Windows 7.  I have no email clients.
    You don't need an Email client nor Adobe Revel account to send email and photos as attachment.  All you need is an email account (could be free web-based account such as Gmail, Outlook, Yahoo, AOL or whatever including from your own ISP.  And of course an Internet Connection.
    Now the most obvious requirement is out of the way so you need to go in to your Organizer and click on Share button and choose Photomail. Select the photo you want to send and follow the instructions that are on your screen.
    You also need to request an Adobe Verification Code to enable you to use Adobe's Mail Servers to send the photos for you.  To do this go to:
    Edit >> Preferences>> Sharing
    Look for something like this and fill out the red boxes where indicated (click on this image to see it clearly).
    Hope this gets you started.

  • How can I attach my form to an email?

    How can I attach my form to an email?

    Go to the distribute tab - you can either email a link to a web form or create a PDF form to send.
    Randy

Maybe you are looking for

  • Header text in form medruck

    hi gurus, i have a requirement to move the header text of the PO after the terms of payment. but in the standard form medruck the codes for header text are in the first line of the main window so it should be display first.but how this header text di

  • Issues with Query Caching in MII

    Hi All, I am facing a strange problem with Query caching in MII query. Have created one xacute query and set cache duration 30 sec. The associated BLS with the query retrieves data from SAP system. In the web page this value is populated by executing

  • Dynamic Selection screen in FDK43 transaction

    HI, The transaction FDK43 has a dynamic selection screen used from LDB DDF .It does not show all selections views in the dynamic selection but when I test the LDB from se36 its shows all the selections in dynamic selections. Any idea why it is not sh

  • List Items

    Hi all , Is it always necessary to give the 'initial value' to the list-item in the forms ? B'coz on one form i am getting the following warning :- FRM-30188: No initial value given, and other values are not allowed (item CTRL.YEAR). List YEAR Block:

  • HTTP tunneling T3 when using WebStart - java.security.AccessControlException: access denied

    Hi ! WLS version: 5.1 with SP10 Server OS: NT4 Client distr.: Java WebStart Client OS: Windows 2000 I get the following exception when I try to create a T3 connection (tunnelled through HTTP) to my WLS server: java.security.AccessControlException: ac