A really handy feature would be to be able to target a symbol instance via the event object.
Right now we have :
Event Object {
timelineName: "Main Timeline",
type: "HypeTimelineAction"
}
If only we could have the id of the symbol Instance if the event was actually trigger from within a symbol. It would be great to avoid duplicating code and creating reusable behaviour for ui symbols for example.
Ex :
Event Object {
symbolInstanceId : "hype-obj-54654654654654",
timelineName: "Main Timeline",
type: "HypeTimelineAction"
}
Thanks.
stephen
(stephen)
March 30, 2015, 8:29pm
2
That sounds like a a great idea, thanks for the suggestion! I will look into this and see if there is a good way for me to add it.
3 Likes
Thanks for taking it into consideration.
I look forward next updates !
Cescomare
(www.360FUN.net)
October 15, 2015, 12:00pm
4
Hi, I was just looking for something like that…
there is no way to get, right now, the caller Symbol from a Symbol Action?
MarkHunte
(Mark Hunte)
October 15, 2015, 1:17pm
5
@Cescomare
Have a look at my post here
If I understand right.
In the Symbols Custom behaviours, set a behaviour to fire the Javascript.
Name the behaviour the same name or id as the Symbol.
Set the Symbols timeline Action to fire the Custom behaviour.
Then in the Javascript you can use
Something like:
var theName = event.customBehaviorName
var thisSymbol = hypeDocument.getSymbolInstancesByName(theName);
( I have used the name instead of the ID here )
Cescomare
(www.360FUN.net)
October 16, 2015, 9:09am
6
Yep, I used that trick in the end since I didn’t find any other (clean) working solution…
In the beta this will work!
console.log( hypeDocument.getSymbolInstanceById(element.id ) );