hate these ads?, log in or register to hide them
Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: Flash Actionscript Help

  1. #1

    Flash Actionscript Help

    I've recently taken over updating a website for my church because I'm the most tech savvy person there, but I don't know anything about flash or actionscript 3 and the entire website is made in it. I've figured out how to update and edit every section except for the .swf file listing all the sermons. It's just a simple file with a list of buttons that play a shine animation when moused over and link to mp3 files. The .fla file will compile into a .swf file just fine when I don't edit anything. But, whenever I add a new sermon, I get this error:

    Code:
    Scene 1, Layer 'Actions', Frame 1, Line 12	1120: Access of undefined property mc20120422.
    (mc20120422 is the name of the sermon movieclip I add to the field)

    This is the actionscript before I edit anything:

      Spoiler:
    Code:
    /*import flash.media.*;
    import flash.events.*;
    import flash.net.*;*/
    
    var LinkSound:sndLinks = new sndLinks();
    var LinkChannel:SoundChannel;
    
    import com.NR.Common.BtnMouseOver.BtnMouseOver;
    var ButtonArray:Array = [mc20120101, mc20120108, mc20120115, mc20120122, mc20120129];
    ButtonArray.push(mc20120205, mc20120212, mc20120219, mc20120226);
    ButtonArray.push(mc20120304, mc20120311, mc20120318, mc20120325);
    ButtonArray.push(mc20120401, mc20120408, mc20120415);
    
    var MoArray:Array = [LinkSound, LinkChannel];
    var mo:BtnMouseOver = new BtnMouseOver(ButtonArray, MoArray);
    
    import com.NR.Common.PlayButtonMouseClick.PlayButtonMouseClick;
    var strSWFBase:String = MovieClip(parent.root).strSWFBase;
    var mc:PlayButtonMouseClick = new PlayButtonMouseClick(ButtonArray, strSWFBase);
    
    import com.NR.Common.FileDownload.FileDownload;
    var mcDownload:Download_mc = new Download_mc;
    mcDownload.x = (this.width - 100)  / 2;
    mcDownload.y = (this.height - 100) / 2;
    
    var mcCover:Shape_mc = new Shape_mc;  //Covers so other links won't continue to work
    mcCover.width = this.width;
    mcCover.height = this.height - 25;
    mcCover.alpha = 0;
    
    var ButtonDownloadArray:Array = [mcDownload.btnCancel];
    var moDownload:BtnMouseOver = new BtnMouseOver(ButtonDownloadArray, MoArray);
    
    var ObjectDLArray:Array = [this, 'Sermon', strSWFBase, mcCover, mcDownload];
    for(var i:int = 0; i < ButtonArray.length; i++) {
    	var fd:FileDownload = new FileDownload(ButtonArray[i], ObjectDLArray);
    }


    My instructions were to duplicate one of the existing buttons under the library and rename it, then add it to the buttonarray.push line. Doing this gives me the above error and causes all the buttons to repeat the shine animation over and over without mousing over and they won't link to the mp3 files when clicked on.

    I'm at my wits end, I've spent days looking around google for the answer but everything is just so far above my head. I've started learning actionscript but that will take time and I want to get the sermon file updated as quick as possible.

    Here's the .fla file and library files if it will help - http://www.mediafire.com/?xmoed67bnzi6q9c

  2. #2

    Join Date
    June 6, 2011
    Posts
    255
    Been ages i fiddled with that shit, but looks like you need to add to mc20120422 to the ButtonArray.

    Edit: nvm, apparently i can't read a post properly to it's end.

    Look at Scene 1, Layer 'Actions', Frame 1, Line 12 and post it
    Last edited by Irrelephant; July 26 2012 at 09:58:09 PM.

  3. #3

    Join Date
    April 10, 2011
    Posts
    7,023
    Why can't God sort his own shitty flash 'website' out?

  4. #4
    Quote Originally Posted by Irrelephant View Post
    Been ages i fiddled with that shit, but looks like you need to add to mc20120422 to the ButtonArray.

    Edit: nvm, apparently i can't read a post properly to it's end.

    Look at Scene 1, Layer 'Actions', Frame 1, Line 12 and post it
    the line is " ButtonArray.push(mc20120401, mc20120408, mc20120415, mc20120422); ". It's just like the above with the added mc20120422 and causes the error and script to not work.

  5. #5
    Donor Fuggin's Avatar
    Join Date
    April 9, 2011
    Location
    Nursing home
    Posts
    3,208
    Quote Originally Posted by Daneel Trevize View Post
    Why can't God sort his own shitty flash 'website' out?
    Why don't you end yourself and ask God himself?
    <&QuackBot> Fuggin: There once was a man named tugginfuggin. He oft tugged his fuggin. That is the tale of tugginfuggin.

  6. #6
    Ben Derindar's Avatar
    Join Date
    April 10, 2011
    Location
    New Zealand
    Posts
    1,187
    (Disclaimer: it's been years since I touched Flash, but) check the properties of your duplicated button in the library. IIRC there's a value you can set which is used to identify the object from the perspective of the actionscript, ie the name of the object as you see it in the library may not be what the actionscript is referring to?
    Last edited by Ben Derindar; July 26 2012 at 10:17:33 PM.

  7. #7

    Join Date
    June 6, 2011
    Posts
    255
    Quote Originally Posted by spasm View Post
    the line is " ButtonArray.push(mc20120401, mc20120408, mc20120415, mc20120422); ". It's just like the above with the added mc20120422 and causes the error and script to not work.
    Ben's post above sounds good, else i would look where the other mc stuff is defined.

  8. #8
    Quote Originally Posted by Ben Derindar View Post
    (Disclaimer: it's been years since I touched Flash, but) check the properties of your duplicated button in the library. IIRC there's a value you can set which is used to identify the object from the perspective of the actionscript, ie the name of the object as you see it in the library may not be what the actionscript is referring to?
    Under symbol properties it lists "mc20120415 copy" as the source symbol name (mc20120415 was the file I duplicated), I added that to the buttonarray and got the same undefined error.
    Last edited by spasm; July 26 2012 at 10:25:21 PM.

  9. #9

    Join Date
    June 6, 2011
    Posts
    255
    Why not change it to mc20120422?

  10. #10
    Ben Derindar's Avatar
    Join Date
    April 10, 2011
    Location
    New Zealand
    Posts
    1,187
    Quote Originally Posted by spasm View Post
    Quote Originally Posted by Ben Derindar View Post
    (Disclaimer: it's been years since I touched Flash, but) check the properties of your duplicated button in the library. IIRC there's a value you can set which is used to identify the object from the perspective of the actionscript, ie the name of the object as you see it in the library may not be what the actionscript is referring to?
    Under symbol properties it lists "mc20120415 copy" as the source symbol name (mc20120415 was the file I duplicated), I added that to the buttonarray and got the same undefined error.
    Hmmm.

    Well I don't have Flash here at work but if your .fla will open in Flash 8 I can have a look when I get home if you haven't solved it already by then.

    My only other thought is a bit of a long shot without being able to look at it, but are your buttons anywhere on the timeline or does the script literally handle the stage placement itself somewhere? If the former, check the name of the symbol instance on the timeline, perhaps that's what the script is referring to?

  11. #11
    Quote Originally Posted by Irrelephant View Post
    Why not change it to mc20120422?
    The name under symbol properties is mc20120422, but under the source section it lists the symbol name as mc20120415 copy and it can't be edited. Neither work when put into buttonarray.

  12. #12
    Quote Originally Posted by Ben Derindar View Post
    Quote Originally Posted by spasm View Post
    Quote Originally Posted by Ben Derindar View Post
    (Disclaimer: it's been years since I touched Flash, but) check the properties of your duplicated button in the library. IIRC there's a value you can set which is used to identify the object from the perspective of the actionscript, ie the name of the object as you see it in the library may not be what the actionscript is referring to?
    Under symbol properties it lists "mc20120415 copy" as the source symbol name (mc20120415 was the file I duplicated), I added that to the buttonarray and got the same undefined error.
    Hmmm.

    Well I don't have Flash here at work but if your .fla will open in Flash 8 I can have a look when I get home if you haven't solved it already by then.

    My only other thought is a bit of a long shot without being able to look at it, but are your buttons anywhere on the timeline or does the script literally handle the stage placement itself somewhere? If the former, check the name of the symbol instance on the timeline, perhaps that's what the script is referring to?
    I'm not sure what you mean. I looked at the timeline and it lists two things, actions and layer 1. I click on layer 1 and highlights all the different buttons including the one I added. I'm not sure how to check which names it's using, I don't see any option to display that info.

  13. #13

    Join Date
    June 6, 2011
    Posts
    255
    Quote Originally Posted by spasm View Post
    I'm not sure what you mean. I looked at the timeline and it lists two things, actions and layer 1. I click on layer 1 and highlights all the different buttons including the one I added. I'm not sure how to check which names it's using, I don't see any option to display that info.
    By adding mc20120422 to buttonArray, you basicly add that movie (or whatever the property references to) to the array. But AS can't find that property at runtime. Hence your error.
    IIRC there was a option to enable export of symbols from a library, so a movie does not have to be on the timeline to be referenced by AS. I would guess that was the missing instrunction.

    fakeedit: check if this is enabled
    Code:
     To export a symbol for ActionScript:
    
        Select the symbol in the Library panel and open its Symbol Properties dialog box.
    
        If necessary, activate the Advanced settings.
    
        In the Linkage section, activate the Export for ActionScript checkbox.
    edit: also, didn't have AS a debugger? set a breakpoint on the frame with the error and check what is where at runtime.
    Last edited by Irrelephant; July 26 2012 at 11:55:27 PM.

  14. #14
    Ben Derindar's Avatar
    Join Date
    April 10, 2011
    Location
    New Zealand
    Posts
    1,187
    Quote Originally Posted by Irrelephant View Post
    fakeedit: check if this is enabled
    Code:
     To export a symbol for ActionScript:
    
        Select the symbol in the Library panel and open its Symbol Properties dialog box.
    
        If necessary, activate the Advanced settings.
    
        In the Linkage section, activate the Export for ActionScript checkbox.
    Yeah that's what I was thinking of in my first post, Linkage -> Export for Actionscript. Now I remember.

  15. #15
    Quote Originally Posted by Ben Derindar View Post
    Quote Originally Posted by Irrelephant View Post
    fakeedit: check if this is enabled
    Code:
     To export a symbol for ActionScript:
    
        Select the symbol in the Library panel and open its Symbol Properties dialog box.
    
        If necessary, activate the Advanced settings.
    
        In the Linkage section, activate the Export for ActionScript checkbox.
    Yeah that's what I was thinking of in my first post, Linkage -> Export for Actionscript. Now I remember.
    Tried exporting for action script. The original buttons will now display the shine animation when moused over but don't link to the mp3s when clicked, and the new button I added doesn't show the shine animation and doesn't link. I didn't get the undefined error though.

  16. #16

    Join Date
    June 6, 2011
    Posts
    255
    Atleast progress, looks like someone forgot more then one detail on how to add a new button.

    Moar debugging then, my short intermezzo with flash ended before AS 2.0 was out, but regarding your linking problem the below looks suspicous to me. Judging by the preceding code using moDownload instead of mcDownload would make more sense. Moot point, if you verified that the linking was working as expected before you made any changes. But in the code you posted the var moDownload is not used at all if this is not a typo. If it was a typo slap the guy who didn't give you the correct source file.

    Code:
    var ObjectDLArray:Array = [this, 'Sermon', strSWFBase, mcCover, mcDownload];
    Calling it a night here, gl. Read up on how to use the debugger, should be straight forward and looking at things at runtime makes finding those bugs alot easier.

  17. #17
    Ben Derindar's Avatar
    Join Date
    April 10, 2011
    Location
    New Zealand
    Posts
    1,187
    OK just got home and tried opening the .fla in Flash 8 (told you it's been a while!) and it doesn't recognise it. So that's me fresh out of ideas, soz.

  18. #18
    Thanks for the help guys but I had an epiphany last night. Instead of trying to add new items to an existing file I took one of the older files and just edited the names and links, it seems to be working fine. Feel kind of dumb that it took me two months to think of that.

  19. #19
    Ophichius's Avatar
    Join Date
    December 15, 2011
    Location
    Hedonistic Imperative
    Posts
    2,070
    Spasm, not to derail too much, but are you locked in to using flash for sitenav? That's incredibly bad form in general, breaks your site for anyone who has to use a screen reader due to disability, and makes your site load extremely slowly. If you can get away from it, I'd recommend it.

    The on-the-cheap way to do videos on the site would be a youtube channel and embed links, and re-write the site in clean HTML. You'll probably speed up your load times by an order of magnitude or so, as well as making the site much friendlier for those with disabilities.

    -O
    I thought what I'd do was, I'd pretend I was one of those Thukkers, that way I wouldn't have to have any goddamn stupid useless conversations with anybody.
    Quote Originally Posted by Nu11u5
    I'm going to stick to a size where the characters' eye orbs are not the size of my skull. That's kind of disturbing.

  20. #20

    Join Date
    April 10, 2011
    Posts
    7,023
    Not just disabilities, but non-pc viewers (smartphones, consoles, etc). Not everything can or will run Flash, but can still handle HTML + video formats.

Bookmarks

Bookmarks

Posting Permissions

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