The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 5 of 5

Thread: FMX2004 - Help needed

  1. #1

    FMX2004 - Help needed

    Hi,
    First can i say this a really good site, love the tutorials and they've helped me alot.
    I am currently trying to create a logging system, this consists of 4 "team" objects, i have got the applications buttons changing the team on the respective team button. Please can someone advise on the following.

    I have my component input boxes setup and on release of a submit button an if statement checks the input and moves an mc to the relevant frame based on the input (1,2 or3). This is working fine but currently works for all objects. I want these inputs to work for all objects independentley. What would be the best way to achieve this?.


    Hope ive explained this clearly enough, I was thinking of creating 4 AS files and placing all variables on those, would this do what i want it to do? I will post any scripts if needed.
    Thanks for any help.
    Last edited by astonvilla65; March 25th, 2012 at 03:15 PM.

  2. #2
    1,391
    posts
    Registered User
    ok let's see if i'm following here so, right now if you change the input it changes ALL objects? so you must be iterating through them is some way - but what you what is a targeting system of some sort so that you can route the input to one element or another - is that correct?

    if so, then you could have a system where you click on an instance, and it becomes 'selected' - store the selection in a property, use that property in a condition within the iteration loop to determine if it is the target and take action

  3. #3
    I have created the 4 objects and using one variable i can state which object loads when the app is run just by changing the name of the var to relate to the wanted object, this is done by targetting the object property for each object. the var (team:String) is changed on each team button to tell a txt field to change the current team name. I don't think it is loading the object though. I have no loops setup currently.

    The if statement is just running on top of everything and doesn't target any objects atm. If i can i want the targeted mc that the if statement moves to be used for all objects but store the data for each object seperatly.

    I would like a targetting system yeah that would route any input to one object or the other. For instance:
    For object1: select the team 1 button to bring that teams stats up, any score input entered when the submit button is selected only affects that object (team1), and the same for the 3 others.

    I know the loop types but not 100% confident in how to use them, i did think of using setFocus (not sure if objects can be given focus though).

    Thanks alot
    Attached Files Attached Files
    Last edited by astonvilla65; March 25th, 2012 at 03:07 PM.

  4. #4
    1,391
    posts
    Registered User
    ok - still pretty difficult to understand you system - but there are a few things i see in the submit_btn.onRelease

    1) you are declaring a variable, then using a condition to check it for the value you just assigned - it will *always* be that value after the assignment - there is no need for the condition
    Code:
    var rommA1:Number = 0;
    if(rommA1 == 0) { ... }
    2) with: A1.indexOf("1") you are asking if there is a match for string "1" within the input String - but you are not checking against the property 'team' as you have set up to change via buttons - but further if successful, you then increment the unneeded variable (which will always end up as 1) then use that to always target the same clip instance "proga1_mc" to gotoAndPlay(1) <- it will never be anything other than 1 where you have this in the code

    i'm guessing (entirely) that you have 'four' clips, proga1_mc, proga2_mc, etc and you want to switch them in that statement and send them to a different frame - but really it's impossible to tell

  5. #5
    Well don't I feel stupid, I was using frame labels instead of MC's and getting ahead of myself, since reading your reply it's (hopefully) dropped into place. Of course I haven't stated what team they are in on the button releases either, makes total sense.

    I'm looking at the prospect of quite a few if statement entries to achieve what I want, this is my first sizeable project using AS2, I think I expected flash to do what I wanted with objects, it does but not how I'd thought. I also tried to plan this because I think this logger can work well and i'm no good at planning atm.

    I am keeping the "indexOf" scripts and using them for the 3 different values and asking through an if statement that it is the correct team, the un-needed variable was stupid, that has been removed and 3 vars for each team setup to increment as needed.

    Thanks for the help, it's appreciated. It has got me back on track and re-focused, if I encounter further actual probs i'll be sure to post.

    Thanks
    Last edited by astonvilla65; March 27th, 2012 at 01:41 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012