Jump to content

ashwani_nair

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by ashwani_nair

  1. Hi,Tanks for explaining the problem.I can think of a workaround, and I am not sure that this is the only or the easiest way to acheive this.I have written codes in flash to call a javaScript function in HTML page and which will navigate to the section of the page.In flash file

    my1_mc.onPress = function(){	getURL("javascript:openNewWindow('" + "#go1" + "');");}my2_mc.onPress = function(){	getURL("javascript:openNewWindow('" + "#go2" + "');");}my3_mc.onPress = function(){	getURL("javascript:openNewWindow('" + "#go3" + "');");}

    and in the <head> tag of the html page

    <script language="JavaScript"><--    function openNewWindow(myURL) {        window.open(myURL);    } -->

    Anyway, this wont work in local machine as the flash player will block the java script in local machine, but it will work through a server. ( I have tried it )Just try it and R&D with it.Hope I was of some help to you..CheersAshwani

  2. Hi There,If you dont want the content to open in the new window, you can leave the second argument blank, that will open the document in the same window.You can also write Java Script in flash.instead of "_blank" you can also use "_top"just have a look at help for getURL, if this is not helping you, i may help you if you could tell me the exact situation.CheersAshwani

  3. Hi,I found out that I can make a script that does something and save it as a comand.The next step would be to make it an MXPBut i must make a msi or something like that first.I read all in help but i do not get it.Can you point me to a place that explains how to take my swf and make it MXP?Thanks in advance.

    Hi Anna,I dont have much idea about MXP, just have a look at this link.MXP referenceMaybe you find something informative.
  4. Hi,If u use dreamweaver then u can directly give a URL to the flash object, but I am not sure about it.And the other way of doing it is say if your swf has a link text or a button in it, u can associate the flowing script to it.

    myMC_mc.onPress = function(){    getURL("www.mylink.htm","_blank");}[\CODE]Hope I was of some help.
  5. yea ive seen alot of them already thanks anyways. i need to be able to click links therefore i suppose xml is the best way forward but no site offers a good tutorial

    Hi Ben,I dont know how much of help my comments will be, but still just giving it a try.Try to load XML into your movie. Use the XML Object ( not component as I dont find it comfortable working with it)use
    var myXML_xml:XML = new XML();myXML_xml.onLoad = function(success){// success = false if xml fails to loadtargetNode = myXML_xml.firstChild.firstChild.firstChild;linkName = targetNode.firstChild.nodeValue;linkTarget = targetNode.nextSibling.firstChild.nodeValue;generateMC(linkName);}function generateMC(linkName:String){    righTab_mc.tab1_mc.link_txt.text = linkName;}tab1_mc.onPress = function(){   // here you can write the navigation function, ie if you want to open a html or an swf or what ever. In case u want to open an html u can use getURL, or if it is an swf then u can have a look into MovieClipLoader class.}myXML_xml.ignoreWhite = true;myXML_xml.load("/myxmlfile.xml");

    again for the above example you need to have the specific xml schema ie something like

    <xml><tag1><linkText>Click here</linkText><linkTarget>"www.w3schools.com"</linkTarget></tag1></xml>

    Hope I was of some help.Thank you

  6. anyone please help me...........how do i load movie in active movie randomly [ loadMovie() or loadMovieNum().....].the that been loaded can interact with active movie, like when i press button in loaded movie, the active movie can give response.anybody understand?............please.... i am in hurry................. :)

    Hi, Please have a root movie and then an empty movie clip into which you can load all your external swf files. I suggest you to use MovieClipLoader() class. This class gives your better control on the swf loaded.Hope I am of some help.
  7. Tahnks alot dude! I will e-mail u in a sec :) Any one else?? :)

    Hi Both,Even though I dont have enough experience building flash games, but I am interesed in doing so, a lot. If a newbee can join you gurus please do mail me atashwanin@techmahindra.com ashwani_nair@yahoo.comashwani.nair@gmail.com
  8. anyone know how to make a random question using actionscript...or some random actionscript... i want to make a question like "who wants to be a millionaire"....the question change after we restart it again... please help me... i found it, but it's hard one... i can't understand..i want simple one.... please some body help me... :)aisya_mafia@yahoo.com

    As suggested kirupa.com is a very good site to get help from.I would like to suggest a method, i dont know if you find it simple or not.you may creat an xml file to store all the questions and answers as
    <xml>    <info>         <question>3 + 2 = ?</question>         <answer>5</answer>    </info>    <info>         <question>3 + 8 = ?</question>         <answer>11</answer>    </info>   <info>         <question>8 + 2 = ?</question>         <answer>10</answer>    </info>   <info>         <question>3 + 12 = ?</question>         <answer>15</answer>    </info></xml>

    so once you have your database of question and answer ready with you. You can load the xml into your flash movie and then split it to an array. This can be done as

    var myXML:XML = new XML();myXML.onLoad = function(success){    if(success){      // here you need to place code which will split the information in the xml object to say some array or object array accordiing to your convinience.    }else{        trace("loading Failed");    }}myXML.load("/myxmlfile.xml");

    once you have done this, you can just load the question to a dynamic textfiled placed on your stage and check if the answer is correct or not.Anyway selection of which question can be done by the function

       displayQuestion(Math.round(Math.Random() * theArray_arr.length));

    The good thing about this is, when ever you want to change the set of questions or say to increase or decrease the number of quesitons.. u just have to replace the XMLHope this is of some help.

  9. Hello,I would like to know if it is possible to manipulate an object in Flash, for example a bar, with data that Flash gets from a database. Propose I have made a 1 inch high bar in Flash. When the data in de database changes, from 1 to for example 8, the bar gets 8 inches high.I want to make a bar in Flash that shows realtime data. Before I work on it I wanted to know if it is possible at all.Thanks,G_A

    I it is possible. But you must have a mechanism in flash to reflect the change in database ( preferably XML ). The mechanism you must use will depend on the project you are workiing on. you can set interval, or enterfram or a loop or something like that or even some kind of trigger from a movieClip whose nth frame will call a funciton in root so that... the movieClip will act as a trigger.
  10. OK this is a little wierd. This also might be a stupid question. I've created a navigation menu using multiple movie clips and now I want to put this drop down menu, witch is consisted of several different movie clips, into one movie clip so that I can make it draggable. It's draggable, that's OK. But here is the problem. Say the navigation menu is is inside of a single movie clip with the instance name of mc_nav. This works, but since the navigation manu is inside of mc_nav it doesn't work. There isn't anything wrong with it, but because of it being inside mc_nav it's like it's got an invisible barrier over it and when you roll over any of the navigation bars in the menu it deosn't work. How do I make it one movie clip and still keep it working?

    Hi,As far as my knowledge ( as I am not sure if I am correct or not ) you have placed a movie clip ( the menu) inside the movie clip mc_nav. Most probably this is happening as your funcitons ( as this.onRollover = function(){} or say this.onPress = function() ) are overridden by the same fincitonis delacred inside mc_nav.if you have written as
    mc_nav.onPress = function(){  this.startDrag();}

    then mostprobably only this funciton will override any function inside it.so try using the combination mouseListener and hittest to get the result.One more suggestion. Please follow naming conventions ie end a movie clip with myname_mc ( this will give you all the options in a drop down list associated with movie clip )text = mytext_txtmovieclip = myMovieClip_mcbutton = myButton_btn etc.Hope I am of some help to you.

  11. OK so here is the deal. I'm making a college portfolio and I need to be able to load different movie clips onto a certain part of the stage. The movie clip depends on the button clicked. One, how do I make the movie clip load? And two, how do I make it load at a certain spot on the stage? Thanks in advance for any help.

    Hi, There are two cases, if you are loading a swf ( it is always better to load an external swf if it is for web ) then you can do as other are suggesting ( placing an empty movieclip an then loading external swf to it). And if you are planning to have movieClips in your library and loading it according to the your selection then you can at first create an empty movieclip and place it on the stage at (0,0) and give an istance name, say myEmpty_mc then u can say.
    myEmpty_mc.attachMovie("myMc","mynewMC_mc",myEmpty_mc.getNextHighestDepth(),{_x:10,_y:10});

    in the above code, "myMC" must be the linkage name of the movie clip to be attached.the x and y position is passed as an object eg : {_x:10,_y:10}

  12. I think flash 5 allow you to export .swf to  .html , do this and view the source code of the .html , take the code from tag <object> ... </object>:)

    What smiles says is a good thing. The problem I see in your codes are that it is hard coded.I prefer you to use relative path rather than coding it hard way to your "c:" driver or any specific drive.
  13. had you try to do the same using XML files. XML can provide values by collecting through other scripts to the flash.

    Hi, As suggested above, the best way is to use XMLs for ur data storage, and in case you are specific that you want to use a asp for this purpose, then its better to use 'loadVars()' as
    var my_lv:LoadVars = new LoadVars();my_lv.onLoad = function(success:Boolean):Void {    if (success) {        trace(this.dayNames); // Sunday,Monday,Tuesday,...    } else {        trace("Error");    }}my_lv.load("http://www.myserver.com/mypage.asp");

    Hope this helps you

×
×
  • Create New...