dcsimg
A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Need some help with components.

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Posts
    27

    Need some help with components.

    Ok Im about to start doing a game but I need help with components. I know you have to drop them into the stage for them to be able to be used in actionscript but is their a way for it just to be used in actionscript without me dropping it into the stage then adding to library. Like just being to use component from just actionscript and nothing more. I wont be able to use Design View and this also will improve my actionscripting. So can some one help me out .

  2. #2
    Junior Member
    Join Date
    Sep 2006
    Posts
    18
    Hi there, I have not done this myself but I am sure you can at least attach a componet with actionscript without any hassle. You can also put components into an external swf and load that in dynamically. Check out the Adobe web site for more flash info.

    l8rz

  3. #3
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    I just want to use actionscript I cant load up any swf files or anything so yah. Because i cant make them ill only have t ime to publish it with everything being created in actionscript. Can you find a way to load them up without doing anything else besides using actionscript.

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    Can some one help?

  5. #5
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    your not being very clear as to what it is you want as your end goal.

    'use components with actionScript' says basically nothing.

    As stated...you do NOT have to drag a component to the stage to use it during your movie. You can script it in AS to be attached to the stage from your library.

    You do this by using attachMovie(); method.

    once this component has been attached ot the stage...and been given an instance name, you can then assign properties to it.

    You can also create movieCLips dynamically/on the fly using code.. as well as textFields.

  6. #6
    Big Baby Fabriq-En-Chine's Avatar
    Join Date
    Sep 2005
    Location
    In My Pants
    Posts
    193
    always try the help files first

  7. #7
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    Ok Ill say it in steps.
    1. make it so you dont have to drag in a component from the list to the stage to add to library.
    2. Using a "BLANK" Library make a Textinput component like if your attaching like so.
    3. this.attachMovieClip("TextInput","NewName",Depth);
    4. thats all done with a "BLANK Library.

  8. #8
    Big Baby Fabriq-En-Chine's Avatar
    Join Date
    Sep 2005
    Location
    In My Pants
    Posts
    193
    i wasn't being facetious when i suggested the help files:

    under "Using Components" you'll find a section entitled "Adding components to Flash documents" which is exactly what you'll need - it takes you step by step through the process - there are other sections in the Using Components section of the help files which tell you everything you'll need to know about using Components.

    Check there first and if you're still having trouble then check back here for more specific advice.

  9. #9
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    Ok I read up on it how would i go about using
    createClassObject()
    To Import Component at runtime i couldnt quite understand that.

    =====EDIT====
    Ok i must be going on about this the wrong way cuz thats what i found but you still need to have the damn component in library.
    Last edited by unkownname; 09-23-2006 at 05:08 AM.

  10. #10
    Big Baby Fabriq-En-Chine's Avatar
    Join Date
    Sep 2005
    Location
    In My Pants
    Posts
    193
    of course you have to have the component in the library... if you don't have something in the library it won't be in the .swf file you export so the swf file won't be able to manipulate it when it runs in the player.

  11. #11
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    ?? your 'blank' library notion is whats stopping you.

    if you dont drag a component to the library from the components panel.. you cant attach it. You cant attach something you dont even have.

  12. #12
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    ... Im not stupid dude I understand that What im asking is their a way so I dont have to do that? THATS WHAT IM BEEN ASKING

  13. #13
    Big Baby Fabriq-En-Chine's Avatar
    Join Date
    Sep 2005
    Location
    In My Pants
    Posts
    193
    ... Im not stupid dude I understand that What im asking is their a way so I dont have to do that? THATS WHAT IM BEEN ASKING
    i really don't know what to say to that....?

    You asked if there was a way to attach a component to the stage without having to put it in the library. There isn't.

    no one called you stupid, or suggested or inferred that's the case - but the answers i and whispers gave are quite clear -the answer is no, you cannot use actionscript to attach a component to the stage that's not in the library at runtime.

    The act of dragging a component into the library (you don't have to drag it to the stage and delete it, just drag straight into the library). is necessary because all components are, essentially, MovieClips - when you write a component you extend the MovieClip class - so in order to use a component you're essentially attaching a MovieClip to the stage - albeit a MovieClip with more functionality than normal.

  14. #14
    Junior Member
    Join Date
    Sep 2006
    Posts
    27
    I wassent saying you said i was stupid i nearly meant that im not being igorant in that part well at least you guys answered my q that you cant thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center