How to pass javascript variables into an Edge Animate project from HTML


i have got basics nailed edge animate - coming flash background it's been straight forward, nice work far (but more on later)

 

i have had build "promoted items" slider homepage on 1 of our sites....previously have been flash animation but, hey ho .

 

i built jquery extension/plugin found time consuming make minor alterations - that's edge came in , seemed fill job pretty well.

 

now moment i'll put on hold whole issue how need able work dom-level elements directly on page (eg, animating divs , images within ul-li structure how these things work) , concentrate on edge specific issue...

 

i've seen few people asking same question, none of answers either a) work @ me , or b) enough need do.

 

see previous solutions here http://support.muse.adobe.com/message/4658175 , here : http://forums.adobe.com/thread/1065343

 

my project uses internal array of data, , while in "preview" mode works reasonably well.

 

in stage creationcomplete event have edge code like, example :

 

 

   var imagesarray = ["images/img1.jpg", "images/img2.jpg", "images/img3.jpg"];    var headlinesarray = ["product 1", "product 2", "product 3"];    var subtxtarray = ["lovely widgets", "smelly doo-dads", "purple whatchamacallits"];    var linksarray = ["http://www.adobe.com", "http://www.adobe.co.uk", "http://www.adobe.net"];     //variables set full internal scope, used after , called sub-elements afterwards    sym.getcomposition().getstage().setvariable("imagesarraydata", imagesarray);  

 

 

this code needs changed via html page calling it.

 

ideally have these elements on page ( <div><h1>product 1</h1><img src="....  etc ) , jquery hell make funky. how need doing in future...that way our content still searchable , findable search bots etc. edge output "static" version of page, tried that, won't work dynamically built objects. there's no way i've found of building array of symbols based on existing dom structure can in jquery itself.

 

however, in meantime i'll settle being able set javascript call somewhere - old flashvars solution (which horrible fudge, worked way data project )

 

i'd rather not use internal json call .... it's adding uneccessary bandwidth , additional server processing when data needs has been retrieved database when html page drawn - , means need make sure json producing web service gets ported accross other projects use same "slider"

 

i've tried removing internal declaration , changing html :

 

<script>

var imagesarray = ["images/img1.jpg", "images/img2.jpg", "images/img3.jpg"];

   var headlinesarray = ["product 1", "product 2", "product 3"];

   var subtxtarray = ["lovely widgets", "smelly doo-dads", "purple whatchamacallits"];

   var linksarray = ["http://www.adobe.com", "http://www.adobe.co.uk", "http://www.adobe.net"];

</script>

<!--adobe edge runtime-->

     <script type="text/javascript" charset="utf-8" src="index_edgepreload.js"></script>

 

 

etc

 

but hasn't worked.

 

i'm going attempt solution using

 

adobeedge.bootstrapcallback(function(compid) { ....

 

as found on http://forums.adobe.com/thread/1065343

 

but doesnt explain how set stage level variables, rather targeting specific edge property

 

anyone got ideas? or scrap project?

 

 

imho : adobe need careful of falling same mindset of anti-flash brigade have.

please remember flash used way more adverts.

at moment, edge work great way put simple animation onto page basic interactivity - suitable basic advert - need our html5 animations , scripts dynamic, data-driven, , portable, , preferably using existing dom elements.

 

one last thing, chance of feature "my page uses jquery, don't import edge's own outdated version"

 

message edited by: j1mp



More discussions in Edge Animate CC


adobe

Comments

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

uppercase letters in url - Joomla! Forum - community, help and support

Joomla! Update is not offering Joomla 3 - Joomla! Forum - community, help and support