That said, JS in Max is really a slightly ugly cousin of browser based javascript. Calls to objects are long winded and basically everything is a bit head wrecking!
So here we go: the first in my "Making Max JS less crap" series... The infamous dollar function! All you need to do to access a max object is give the object a scripting name in the inspector* and then use: $('scriptingname')
Please see right hand pane before copying my code>>
function $(stringref){
stringref=stringref.replace(/parent/gi, "parentpatcher")
var path=stringref.split('.')
var obj=this.patcher
for(i in path){
if(path[i]=='parentpatcher'){ //up 1 level:
obj=obj.parentpatcher
}else{
obj=obj.getnamed(path[i])
if(i!=path.length-1){ //down 1 level:
obj=obj.subpatcher()
}
}
}
return(obj)
}
//USAGE:
$("myButton").message('set','new text!') //access 'myButton' object in current patcher
$("parent.myButton").message('set','new text!') //access 'myButton' object in parent patcher
$("myPatcher.myButton").message('set','new text!') //access 'myButton' object in child patcher
$("parent.myPatcher.myButton").message('set','new text!') //access 'myButton' object in sibling patcher
* If you're not bothered giving every patcher a unique scripting name in the inspector, try my lazy dollar function instead.UPDATE:
A good way to use this function is to use Luke Hall's include script. Save his script into your jsexternals folder, save my functions into your project folder as basefunctions.js (or something similar) and then you can simply use include(this,"basefunctions.js") at the top of every JS file you use. Thanks Luke - this is awesome!
67 comments:
Just a quick mention of the "jsextensions" folder in the Max search path. It's the best home for these types of utility functions as you can then use them in any other javascripts you write.
BUG: After some testing it turns out there are some problems calling this function in a for/while loop. Max seems to be mildly retarded when it comes to JS and the speed of the for loop is too fast for the function (wtf?!) and the program crashes like a big bastard.
This was helpful. I have prototypes on my array objects so I needed to change the loop invariant to explicitly run for the length of the split path.
cheap jordans
louis vuitton handbags
cheap nfl jerseys
supra for sale
christian louboutin shoes
fitflops sale clearance
uggs
michael kors outlet
toms shoes
lebron james shoes
20161228caiyan
In the long run, a bag tackk.com/ can have a zillion bells as well as Check This Out whistles however if it doesn't swallow you up like Leading 8 Finest Blender For Smoothies Or Food Processor Mixer Combos your preferred down comforter if it does not keep.
Cordless as well as electric sites.google.com/ blowers will commonly clear up Title to six to ten inches of snow, yet you may have to work to get Snow Blower Buying Guide 2017 them through much heavier snowfalls.
With this adjustment in the market, the Web Developers should take up appropriate preparing to keep them refreshed and sparkle in the Web Development field. css
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or learn thru JavaScript Online Training in India. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai
20180623xiaoke
christian louboutin
oakley sunglasses wholesale
kd 10 elite
ray ban sunglasses outlet
pandora charms
true religion jeans sale
ralph lauren outlet
canada goose jackets
ugg boots on sale
chloe sunglassess
jordan 8
balenciaga triple s
givenchy handbags
parajumpers jackets
ralph lauren
new balance shoes
nike air max 1
visconti pens
lebron soldier 11
giuseppe zanotti
chenyingying20180925
adidas superstar
longchamp handbags
true religion
abercrombie and fitch
converse outlet store
coach outlet
seahawks jerseys
salomon shoes
ai max
ray ban sunglasses
2018.11.12xukaimin
Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
Java training in Chennai
Java training in Bangalore
I appreciate that you produced this wonderful article to help us get more knowledge about this topic.
I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
Played on BGAOC with big wins? NOT? Come to us as soon as possible and win with us. perfect all slots casino Come get your chance to win.
I am obliged to you for sharing this piece of information here and updating us with your resourceful guidance. Hope this might benefit many learners. Keep sharing this gainful articles and continue updating for us.
oneplus service centre chennai
oneplus service centre
oneplus mobile service center in chennai
The article is so informative. This is more helpful for our
software testing training courses
selenium testing training
software testing training institute
Thanks for sharing.
This article is very helpful.
web designing training and placement
php training with placement in chennai
magento training in chennai
great work!!!
Learn Digital Marketing Course Training and Placement Institute in Chennai
The article is so informative. This is more helpful for our
Learn best software testing online certification course class in chennai with placement
Best selenium testing online course training in chennai
Best online software testing training course institute in chennai with placement
Thanks for sharing.
Lovely post! This is a very fruitful post and I am impressed with the effort you have so obviously put into this content. Thanks for sharing.
Oracle Training in Chennai
Oracle Training
Social Media Marketing Courses in Chennai
Tableau Training in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
Power BI Training in Chennai
Oracle Training in Velachery
Valuable one...thanks for sharing...
javascript training in chennai
javascript training in velachery
javascript training courses
javascript training classes
javascript course fees
javascript training in chennai
core java training in chennai
Photoshop Classes in Chennai
Manual Testing Training in Chennai
Drupal Training in Chennai
Fantastic blog!!! Thanks for sharing with us, Waiting for your upcoming data.
Digital Marketing Course in Chennai
Digital Marketing Course
digital marketing institute in chennai
Digital Marketing Training in Chennai
Digital marketing course in Tnagar
Digital marketing course in Thiruvanmiyur
Big data training in chennai
Software testing training in chennai
Selenium Training in Chennai
JAVA Training in Chennai
I believe that your blog would help the readers by giving them a useful information. Waiting for more updates from this admin.
Spoken English Classes in Coimbatore
Best Spoken English Classes in Coimbatore
Spoken English Class in Coimbatore
Spoken English in Coimbatore
Spoken English Classes in Chennai
IELTS Coaching in Chennai
English Speaking Classes in Mumbai
IELTS Classes in Mumbai
Spoken English Class in Anna Nagar
IELTS Coaching in Tambaram
thanks for your information really good and very nice web design company in velachery
Qbigpro is the best web designing company in chennai.we are doing web designing and developing website creation website maintenance graphic designing google ads logo creation in our company.web design company in velachery.
Flying Shift - Packers & Movers in Bhopal
For Data Science training in Bangalore, Visit:
Data Science training in Bangalore
For Blockchain training in Bangalore, Visit:
Blockchain training in Bangalore
Aluminium Composite Panel or ACP Sheet is used for building exteriors, interior applications, and signage. They are durable, easy to maintain & cost-effective with different colour variants.
Awesome post. Good Post. I like your blog. You Post is very informative. Thanks for Sharing.
Hadoop Training in Noida
Informatica Training in Noida
R Programming Training in Noida
Nice post shared.
tree trimmers palm beach county
I believe that your blog would help the readers.
san diego remodeling contractors
Nice Post.
residential tree services fort lauderdale
Nice Post. Check out this site for tree pruning
Great post.
tile reglazing minneapolis
Superbly written article.
commercial solar panel installation fort lauderdale
Nice post.
concrete driveway contractors minneapolis
Perfect post shared.concrete driveway contractors miami
Thanks for sharing.
concrete driveway contractors port st lucie
Awesome blog.
patio resurfacing minneapolis
Thanks for one marvelous posting!
patio resurfacing port st lucie
Superb. I really enjoyed very much with this article here.
kandol lake
wonderful post .
crypto airdrop
This article very helpful.
ico rating
Great!! just awesome blog.
123 movie
I like the helpful info you provide in your articles.
airdrops
Hi, Thanks for sharing this information.
123 movies
thanks for sharing this such types of topics.
AWS Solutions Architect Training in Bangalore.
https://onlineidealab.com/aws-training-in-bangalore/
thanks for informing us about this articles.
AWS Certification course.
https://onlineidealab.com/aws-certification/
Excellent information with unique content and it is very useful to know about the information.angular 7 training in bangalore
This Information which you provided is very much useful for Agile Training Learners. Thank You for Sharing Valuable Information.sap s4 hana simple finance training in bangalore
Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.javascript training in bangalore
I must appreciate you for providing such a valuable content for us. This is one amazing piece of article.Helped a lot in increasing my knowledge.sap hr training in bangalore
Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.html training in bangalore
Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge. Amazon web services Training in Bangalore
Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.devops training
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site. sap s4 hana training in bangalore
Awesome,Thank you so much for sharing such an awesome blog. sap fico training in bangalore
Thanks for sharing this blog. This very important and informative blog. Python Training in Bangalore
Wow, marvelous blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your web site is excellent, let alone the
content!
Go123movies
Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…
Learn SAP Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best SAP ABAP Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
Thank you for sharing such a nice post!
Get SAP ABAP Training in Bangalore from Real Time Industry Experts with 100% Placement Assistance in MNC Companies. Book your Free Demo with eTechno Soft Solutions.
מעולה. תודה על הכתיבה היצירתית.
קבוצת גבאי אלי גבאי
מזל שנתקלתי בכתבה הזאת. בדיוק בזמן
פינת אוכל עגולה
Such a nice article.
שערי אלומיניום
Post a Comment