Is there a way to create a math.random that doesn't overlap movieclips?

Hi,
Actually I have two questions. I am creating a memory sequence game and I was wondering:
1. Is there a way to random position movieclips on the stage without having them overlap each other?
2. Is there  a way to have flash draw a vector line from one clip to another in sequence and then have the user retrace what flash did? I have 6 movieclips on the stage, each with their own instance (ex. obj1_mc, obj2_mc, etc.). Is there a way to tell flash to always draw a line between movieclips in sequence even though the movieclips are randomly placed on the stage?
Thanks,
OJ

sure.
1.  the easiest way to position objects without over-lapping, IF you can assume it will always be possible, is to use something like:
var mcA:Array=[your movieclips]
var index:uint=0;
positionF();
function positionF(){
// assuming top-left reg points of your movieclips
mcA[index].x=Math.random()*(stage.stageWidth-mcA[index].width);
mcA[index].y=Math.random()*(stage.stageHeight-mcA[index].height);
var hitBool:Boolean=false;
for(var i:int=0;i<index-1;i++){
if(mcA[index].hitTestObject(mcA[i])){
hitBool=true;
break;
if(hitBool){
positionF();
} else {
index++;
if(index<mcA.length){
positionF();
} else {
// positioning complete.  do whatever
2.  you can use the graphics class to draw dynamic lines.

Similar Messages

  • Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content?

    Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content? By anyone, I mean someone who can download and use the free Adobe Reader, on either a Mac or PC. I have Acrobat Pro, and would like to be able to create forms that can not only be filled out and printed, but saved and emailed, which is not an option with the forms I have created to date. They can be filled out, but not saved, with Adobe Reader.
    TIA,
    Nancy

    To do what Dave indicated you need to do, it depends on what version of Acrobat you have:
    Acrobat 8: Advanced > Enable Usage Rights in Adobe Reader
    Acrobat 9: Advanced > Extend Features in Adobe Reader
    Acrobat 10: File > Save As > Reader Extended PDF > Enable Additional Features
    Acrobat 11: File > Save as Other > Reader Extended PDF > Enable More Tools (includes form fill-in & save)
    I wonder what it will be next time?

  • Is there a way to create a new Calendar that replicates all events

    Is there a way to create a new Calendar that replicates all events from a subscribed calendar ? Mobile Me is great but my most important Calendar is technically in the "Subscriptions" category so it doesn't get pushed to me iPhone. I want to create a new Calendar and have it just automatically copy all the events from the subscribed calendar and keep up to date with that one.

    lincolnroadjeff,
    I subscribed to a Holiday calendar that I also wanted to be published, and the only workaround that I found was to export the calendar, delete the subscription, and then import the calendar.
    This obviously will only work with a subscription that is not often updated/subject to change.
    ;~)

  • Is there a way to create standard text messages that can be reused easily

    is there a way to create standard text messages that can be reused easily

    if you meant phrases, then Yes
    Setteings> general>keyboard> add new shortcut

  • Is there a way to create a Smart Mailbox that shows Sent emails only?

    Hi there,
    I am trying to find a way to create a smart mailbox that only shows emails I have sent.
    If I receive 20 emails today, 10 yesterday say, I have a Smart MB where I have set up emails received today, another SMB for emails received yesterday and another SMB for emails I've received in the past week. I can very easily see what has come in during the last few days or whatever.
    What I also have are rules that move all emails received and sent to specific folders. The idea is that I will have nothing in my INBOX. The problem is that although it's easy to set up views to see what emails I've received on any day using the calendar option, I can't see a way of doing this to see what emails I've sent.
    So, if I receive 20 emails today and I replied to 3 of them, those 3 will get sent to whatever folder I've allocated for them - I put all emails TO/FROM in one folder for each email address. This way I don't have 2 email folders TO and SENT for each recipient.
    My problem is that I want to ONLY look at what I've sent today or maybe yesterday etc. if I can set things up the same way as receiving emails, But I can't seem to do this.
    Seems strange that there are options to see filter out what's coming in but not what is being sent! But if there's a way to do this, it would be appreciated.
    Regards,
    Maz

    Mail creates a Sent mail folder automatically when you set up an account. All your sent mails are kept there. You configure how it saves your sent mail here:
    You should see the mailbox in Mail's sidebar:

  • Is there a way to create a file merge that updates from the original source file if changes are made?

    I have thousands of PDF documents that are merged with other files. I'll give an example so it's easier to understand.
    File #1 may be merged (or in a portfolio) with Files #2 and #3 but also in another merge (or portfolio) with Files #3 and #4.
    If I update File #1, is there a way for it to automatically update both of the merge or portfolio files with the updated File #1? (File#1 would be replaced, same name and location).
    I'm using windows and Adobe Acrobat Pro

    You would need to add favorites to the WebHelp output prior to creating a CHM. You would need something along the lines of: http://www.wvanweelden.eu/product/favorites-widget-webhelp
    But since it's in a CHM, I'm not sure whether you will be able to save anything from the webhelp output between sessions.
    Kind regards,
    Willam

  • Is there a way to create a dynamic random playlist?

    I am upgrading (downgrading?) from a 60gb 5G iPod to a Touch. Since the Touch has less space on it than my former iPod, I would like to know if there is a way to have it filled with different random songs each time it is docked.
    I know how to create a playlist that consists of random songs, but I want this list to change periodically, so that I have a different variety of songs available on the Touch.
    Is there a way to do this?

    You need to make sure that the smart playlist has a criterion that will vary with time, such as Playcount is not 0, or Last played is not within the last x days". You also need to make sure that live updating is checked.
    You may need to play around with it a little to get the mix you like.

  • Is there a way to create a user account that "expires", or self deletes itself after a set amount of time?

    I am hoping to find a way to create an Admin account for our parent body that can be used for items at home, "adding printers, software, wireless settings, etc...), but have that account either "expire" or self delete itself after say 72 hours?
    Thoughts?
    Jesse

    Will they be needing to keep files saved for a while?  I'm guessing no, since you're ok with it auto-deleting after a short while.
    You could just use the guest user:  http://support.apple.com/kb/PH11321
    But I'm not aware of any way that you could setup an account to expire.

  • Is there a way to create reusable HTML Forms that can be used on multiple pages?

    I'm trying to understand the recommended approach to managing 10 HTML forms that will be reused on many different pages.  I want to be able to modify the form definition once and have the change propogate.

    Is your requirement that authors be able to change the form definition, or should form definition be controlled by developers?
    In the case of authors being able to change the form definition then I would say best practice would be to create a page that holds the form definition (using whatever components work for you - either the out of the box form components or something custom). Then use the reference component to point the definition in all the other locations you want the form to appear. One thing to note is if you are using dispatcher for caching you need to make sure you strategy for cache flushing accomadates this approach.
    In the case of developers controlling the form definition you could crate a component for each form, and then simly drag that component onto the pages that require the form. In this case your would control all the form label and description elements in the localization file.

  • Is there a way to create a text field that shows on all slides?

    I'm trying to create a "Revised On" date field that can be shown on every slide. Or, do I just have to copy and paste on all slides?
    Thanks in advance.
    - Michael

    use the master slides
    view > show master slides
    click on the master slide that has a tick mark
    add a text box to master slide and any other objects that you want on every slide; enter text, then position, size and set colour
    click on the normal slide and add other content that is to be seen on that slide only
    adding new slides will use the background design

  • Is there a way to create a group alias that I can text/message?

    Similar to an e-mail alias that contains multiple e-mail addresses which makes it easy to send one message to multiple people, I'd like to be able to create a group alias from some set of contacts in my Address Book that I can send a message (either text or iMessage if supported by the recipient) to.  Does the iPhone 4 running iOS5 support this and if so, how do I go about using this feature? 
    Note, I'm not looking for a group chat function where people have run a particular app in order to join a group, I just want to be able to easily send a message to > 1 person and if they want to respond it's directly to me.

    You can group your contacts, but you will not be able to send group messages natively. You need a 3rd party application for this. I have developped a free one, Easy Group, to create group of contacts (family, football team), and then send group texts and group emails.
    http://itunes.apple.com/fr/app/easy-group/id461469079?mt=8
    Rémi
    Note: I may receive some form of compensation, financial or otherwise,from my recommendation or link.

  • Is there a way to create a smart playlist that lists my top 25 plays from a specific time period (i.e. - top plays from the last 90 days)?

    Is it possible to create an itunes smart playlist that lists my top 25 most played songs in a specific time period (i.e. - the last 90 days)?  It seems that any "most played" list I create counts every spin a track has had in it's history of being in my library. 

    The challenge is is not to determine which of the tracks that have been played in the last X days has been played most since the beginning of time, but which have been played most in the last X days. iTunes can do the first one but it simply doesn't have the power to do the second.
    tt2

  • Is there a way to create a popup to a page in URL Redirect ?

    I have a button (also with a report link column) that is doing a URL Redirect to another page in my app. This works fine.
    However, some pages I branch to are small forms and a popup of that form would be more appropriate.
    Is there any way to create a URL Redirect that redirects as a popup rather than a page navigation? Similarly, can you branch to a popup page with a report link column?
    Thanks,
    Reid
    Edited by: reidster on Jul 30, 2009 7:10 PM

    With your help, I was able to create a popup on a report link column using this:
    I just added an "a href" around it.
    Thanks again!
    Edited by: reidster on Jul 30, 2009 10:18 PM
    Edited by: reidster on Jul 30, 2009 10:18 PM

  • Is there a way to create an interactive form without Acrobat

    Bottom line, is there a way to create an interactive form that can either be filled out and saved, or "submitted" with a mailto: button without having to buy a copy of acrobat too.
    I have found numerous tutorials and examples, but everytime I try I run into the "action is not supported" error from adobe reader. Ironically, I have not problems saving a filled out form with OSX preview, but that won't work for PC users.
    It seems like Adobe missed a step or is just forcing users to buy a secondary product to "re-save" a file with a form.

    It’s not a failing at all. It’s just the way it is.
    If you’d like to file a feature request you can do so here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Bob

  • Is there a way to create a sequence by using multiple playlists?

    Is there a way to create a sequence so that music from several playlists is played in a specific order.
    For example:
    1 song from playlist 1
    3 songs from playlist 2
    5 songs from playlist 3
    1 song from playlist 4
    After which it restarts.

    No. Create a new PL with the sequence that you want. You can tell the PL to repeat itself.
    MJ

Maybe you are looking for

  • How do I take an old iPhone off my account so that someone else can use it?

    I gave my old iPhone to my husband and registered it with itunes but he didn't find it easy to use and gave it to our son who did the same exercise with it.  However, because it is associated with my account and my husband's, my son can't do various

  • Save File as txt using VBA

    I am looking to save a pdf file as plain text through VBA, however I am getting the error "Security Settings Prevent access to this property or method". I am using Acrobat 9.0 Standard.  Please help! Here is the code I am using in VBA: Dim AcroXApp A

  • Container Managed Transactions II

    I have a session bean method called insertComanda(). Its transaction attribute is "required". public void insertComanda (Table1VO vo1, Table2VO vo2) throws Exception daoTable1.insertTable1(); //Inserts data in table 1 daoTable2.insertTable2(); //Inse

  • Epson RX595 and Jabra a320s Bluetooth adapter?

    Hi all, Just a quick question. I have an RX595 currently connected to my Time Capsule, and seeing as it is giving me difficulty with a Vista laptop (printing multiple copies of same job) I was looking into other connectivity options that don't includ

  • PO aging Report

    can anyone suggest any standard report close to the following user requirements, To monitor open PO with ageing period - PO number/item/qty/value - Balance PO qty and value - PR number - cost object / requisitioner - last GR/SES - ageing, from PO rel